PHP code example of alirezaashrafi / php-file-cache
1. Go to this page and download the library: Download alirezaashrafi/php-file-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/ */
alirezaashrafi / php-file-cache example snippets
use AlirezaAshrafi\Cache;
use AlirezaAshrafi\Cache as FileCache;
$directory = __DIR__ . '/cache-dir';
$file = 'products';
$cache = new Cache($directory , $file);
// OR
$cache = new Cache(__DIR__ . '/cache-dir' , 'products');
$cache->set("product-1-name", "Iphone 13");
$cache->set("product-1-description", "Iphone 13 pro max 256G");