Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // Test default memcached server. Load, then refresh.
- if (class_exists('Memcache')) {
- $meminstance = new Memcache();
- } else {
- $meminstance = new Memcached();
- }
- $meminstance->addServer("127.0.0.1",11211);
- $result = $meminstance->get("test");
- if ($result) {
- echo $result;
- } else {
- echo "No matching key found. Refresh the browser to add it!";
- $meminstance->set("test", "Successfully retrieved the data!") or die("Couldn't save anything to memcached...");
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement