PHP code example of graymatterlabs / simple-cache

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

    

graymatterlabs / simple-cache example snippets


$cache = new ArrayCache(); // new CookieCache('cookie-name');

$cache->set($key, $value, $ttl); // bool
$cache->setMultiple($values, $ttl); // bool
$cache->get($key, $default); // $value|$default
$cache->getMultiple($keys, $default); // iterator|$default
$cache->delete($key); // bool
$cache->deleteMultiple($keys); // bool
$cache->has($key); // bool
$cache->clear();