Created
August 21, 2018 18:11
-
-
Save mansurali901/4be611e35abc0e33a6b70831de2cb745 to your computer and use it in GitHub Desktop.
A PHP Script to test memcache server
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$mem = new Memcached(); | |
$mem->addServer("127.0.0.1", 11211); | |
$result = $mem->get("blah"); | |
if ($result) { | |
echo $result; | |
} else { | |
echo "No matching key found. I'll add that now!"; | |
$mem->set("blah", "I am data! I am held in memcached!") or die("Couldn't save anything to memcached..."); | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment