$memcache->set('key', $tmp_ , false, 10) or die ("Failed to save data at the server"); echo "Store data in the cache (data will expire in 10 seconds)<br/>/n";
$get_result = $memcache->get('key'); echo "Data from the cache:<br/>/n";
var_dump($get_result);
?>
如果有输出如下代码: Server's version: 1.4.5 Store data in the cache (data will expire in 10 seconds) Data from the cache: (stdClass)#3 (2) { ["str_attr"]=> string(4) "test" ["int_attr"]=> int(123) } 则说明,我们的 Memcached 已经正常运行啦! :~>