##########################telnet连接
telnet 192.168.3.3 11211
stats
add abc 0 60 5
hello
add 是指令名
abc是key的名字 (是以key/value存放),
0 标志,
60 表示数据存放 60s
5表示 放入多大数据
如果一个key已经存在,再放入是失败的
get abc
#######################php测试脚本
<?php
//连接
$mem = new Memcached;
$mem->addServer("192.168.16.31", 11211) or die ("Could not connect");
//$mem = memcache_connect('192.168.16.31', 11211);
//保存数据
$mem->set('key1', 'This is first value', 0, 60);
$val = $mem->get('key1');
echo "Get key1 value: " . $val ."</br>";
//替换数据
$mem->replace('key1', 'This is replace value', 0, 60);
$val = $mem->get('key1');
echo "Get key1 value: " . $val . "<br>";
//保存数组
$arr = array('aaa', 'bbb', 'ccc', 'ddd');
$mem->set('key2', $arr, 0, 60);
$val2 = $mem->get('key2');
echo "Get key2 value: ";
print_r($val2);
echo "<br />";
//删除数据
$mem->delete('key1');
$val = $mem->get('key1');
echo "delete key1<br>";
echo "Get key1 value: " . $val . "<br />";
//清除所有数据
$mem->flush();
echo "delete all<br>";
$val2 = $mem->get('key2');
echo "Get key2 value: ";
print_r($val2);
echo "<br />";
//关闭连接
$mem->quit();
?>
-------------------------------
返回结果
#################对比memcache
<?php
//连接
$mem = new Memcache;
$mem->connect("127.0.01", 11211);
//保存数据
$mem->set('key1', 'This is first value', 0, 60);
$val = $mem->get('key1');
echo "Get key1 value: " . $val ."<br />";
//替换数据
$mem->replace('key1', 'This is replace value', 0, 60);
$val = $mem->get('key1');
echo "Get key1 value: " . $val . "<br />";
//保存数组
$arr = array('aaa', 'bbb', 'ccc', 'ddd');
$mem->set('key2', $arr, 0, 60);
$val2 = $mem->get('key2');
echo "Get key2 value: ";
print_r($val2);
echo "<br />";
//删除数据
$mem->delete('key1');
$val = $mem->get('key1');
echo "Get key1 value: " . $val . "<br />";
//清除所有数据
$mem->flush();
$val2 = $mem->get('key2');
echo "Get key2 value: ";
print_r($val2);
echo "<br />";
//关闭连接
$mem->close();
?>
#################################################################
PS:memcached 连接服务器改成:
关闭连接改成:
public bool Memcached::quit ( void )
参考网址:http://php.net/manual/zh/book.memcached.php
In 2012, there was a push for south Jersey to allow gamblers to use mobile units to gamble in casinos, pushed by Senator Jim Whelan, to compete with Las Vegas. At the time, mobile gaming units have been already adopted in Las Vegas in casinos, allowing casinos to extend gaming flooring to their outer premises. In 2012, the New Jersey Legislature permitted "the use of of} hand-held playing units at Atlantic City casinos," and was waiting on the Governor's signature to cross. The new regulation requires any on 바카라사이트 line casino that gives mobile sports wagering, and each mobile sports wagering platform supplier, to submit an in depth annual again to} the Commission. The finest on-line playing websites enable gamers to wager on sports and on line casino video games such as blackjack and slots.
回复删除