PHP code example of zebrains / file-cache
1. Go to this page and download the library: Download zebrains/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/ */
zebrains / file-cache example snippets
$key = '1:/catalog/product1';
$data = '<html><head><title>Hello world</title></head><body><p>Hello world!</p></body></html>';
$ttl = strtotime('now') + 60*60*24;
$manager->set($key, $data, $ttl);
var_dump($manager->get($key));
$tags = ['catalog', 'product1'];
$manager->setWithTags($key, $data, $tags, $ttl);
var_dump($manager->getByTag('catalog'));