Advertisement
Guest User

test

a guest
Feb 19th, 2018
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. <?php
  2.  
  3. error_reporting(E_ALL|E_STRICT);
  4.  
  5. ini_set('display_errors', true);
  6.  
  7. $mem = new memcached();
  8.  
  9. $mem->addServer("127.0.0.1", 11211);
  10.  
  11. $result = $mem->get("Test");
  12.  
  13. if ($result) {
  14.  
  15. echo $result;
  16.  
  17. } else {
  18.  
  19. echo "Test key not found, adding key";
  20.  
  21. $mem->set("Test", "I found a match, memcache is working") or die("Nothing Saved...");
  22.  
  23. }
  24.  
  25. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement