PHP code example of traineratwot / cache

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

    

traineratwot / cache example snippets


$key = ['key'];
$value = ['value'];

\Traineratwot\Cache\Cache::setCache($key,$value,600,'category/subcategory')

\Traineratwot\Cache\Cache::getCache($key,$value,600,'category/subcategory')

\Traineratwot\Cache\Cache::call($key,function($v) use ($key){
if(count($key) === 1){
	return $v
	}
	return 'noValue'
},600,'category/subcategory',$value)

\Traineratwot\Cache\Cache::autoRemove()

\Traineratwot\Cache\Cache::removeAll()