PHP code example of mezon / cache

1. Go to this page and download the library: Download mezon/cache library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

mezon / cache example snippets


$cache = Cache::getInstance();

$cache->set('key', 'data to be stored');

$cache->flush();

var_dump($cache->exists('key')); // bool(true)
var_dump($cache->exists('unexisting-key')); // bool(false)

var_dump($cache->get('key')); // string('data to be stored')