Skip to content

Instantly share code, notes, and snippets.

@kejyun
Created December 8, 2013 05:52
Show Gist options
  • Save kejyun/7853806 to your computer and use it in GitHub Desktop.
Save kejyun/7853806 to your computer and use it in GitHub Desktop.
php測試Memcache
<?php
// 連線Memcache
$meminstance = new Memcache();
$meminstance->pconnect('localhost', 11211);
// 存放資料到Memcache
$cache_key = 'hello_memcache';
$cache_data = 'cache_info';
$meminstance->set($cache_key, $cache_data, 0, 600);
// 讀取Memcached存放的資料
$res = $meminstance->get($cache_key);
var_dump($res);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment