PHP code example of dcrphp / cache

1. Go to this page and download the library: Download dcrphp/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/ */

    

dcrphp / cache example snippets


$clsCache = new Cache();
//$clsCache->setConfig( array('enable' => 1, 'driver' => 'php_file') );
$clsCache->setConfigFile('cache.php');
$clsCache->init();
//设置
$clsCache->save('key', 'value', 0);
//获取
echo $clsCache->fetch('key');