Created
December 8, 2013 05:52
-
-
Save kejyun/7853806 to your computer and use it in GitHub Desktop.
php測試Memcache
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 | |
// 連線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