Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
php and memcache example
$mem = new Memcached();
$mem->addServer("", 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.