(1)
$mem = new Memcache; $mem->connect("192.168.x.y", 11211)or die ("Could not connect"); $mem->set('key', 'This is a test!', 0, 60); $val = $mem->get('key'); echo $val; ?> (2) < ?php //连接 $mem = new Memcache; $mem->connect("192.168.0.200", 12000); //保存数据 $mem->set('key1', 'This is first value', 0, 60); $val = $mem->get('key1'); echo "Get key1 value: " . $val ."Uid | "; echo "Username | "; echo "PassWord | "; echo "Gender | "; echo "
---|---|---|---|
".$result[$i][$j]." | "; } echo "
欢迎光临 PHP开发笔记 (http://phpvi.com/) | Powered by Discuz! 6.1.0 |