PHP code example of tdt / cache

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

    

tdt / cache example snippets



$c = Cache::getInstance( array("system" => "Memcache", "host" => "localhost", "port" => 11211 ) );
$c->set("key", $objectToCache, $TTL); // TTL is optional

$cachedObject = $c->get("key");
// delete the cachedObject
$c->delete("key");