PHP code example of aichenk / kay-cache

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

    

aichenk / kay-cache example snippets


use KayCache\Cache;

$options = [
    'host'       => '127.0.0.1',
    'port'       => 11211,
    'lifetime'   => 3600,
    'prefix'     => '',
    'serialize' => 'php'  // php|json|igbinary|msgpack
];
$cache = Cache::memcache($options);

$cache->set('test', '111');
$data = $cache->get('test');

print_r($data);

$keys = $cache->queryKeys();
print_r($keys);