PHP code example of tikaszvince / key-value-store-memcache

1. Go to this page and download the library: Download tikaszvince/key-value-store-memcache 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/ */

    

tikaszvince / key-value-store-memcache example snippets



use AdammBalogh\KeyValueStore\KeyValueStore;
use AdammBalogh\KeyValueStore\Adapter\MemcacheAdapter as Adapter;

$memcacheClient = new Memcache();
$memcacheClient->addServer('localhost', 11211);

$adapter = new Adapter($memcacheClient);

$kvs = new KeyValueStore($adapter);

$kvs->set('sample_key', 'Sample value');
$kvs->get('sample_key');
$kvs->delete('sample_key');