Memcache test connection script

Written by

in

,


connect('127.0.0.1', 11211) or die ("Could not connect");

// Add it to memcached server
// The parameters are: KEY, VALUE, USE COMPRESSION, EXPIRY IN SECONDS
$memcache->set('MyKey1', 'The value of My Key1 is me', false, 100);

echo $memcache->get('MyKey1');
// It will show you: The value of My Key1 is me
?>

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *