Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
php and memcache example
<?php
$mem = new Memcached();
$mem->addServer("127.0.0.1", 11211);
$result = $mem->get("username");
if ($result) {
echo $result;
} else {
echo "No matching key found. I'll add that now!\n";
$mem->set("username", "my_secret_passwd\n") or die("Couldn't save anything to memcached...\n");
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.