Guest User

Untitled

a guest
Aug 13th, 2013
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3. $apc_key = 'abc';
  4.  
  5. if (isset($_GET['clear'])) {
  6.     apc_delete($apc_key);
  7.     header('HTTP/1.1 302 Found');
  8.     header('Location: http://json.daverandom.com/apc.php');
  9.     exit;
  10. }
  11.  
  12. if (!apc_exists($apc_key)) {
  13.     $message = 'New data';
  14.     $apc_data = array(
  15.         'test'=>'123',
  16.         'data'=>'test123456');
  17.     apc_store($apc_key, $apc_data);
  18. } else {
  19.     $message = 'Saved data';
  20. }
  21.  
  22. ?>
  23. <html>
  24.     <head>
  25.         <title>APC test</title>
  26.     </head>
  27.     <body>
  28.         <?=$message?>
  29.         <pre>
  30. <?php var_dump(apc_fetch($apc_key)); ?>
  31.         </pre>
  32.         <a href="?clear">Clear It</a>
  33.     </body>
  34. </html>
Advertisement
Add Comment
Please, Sign In to add comment