Home >Backend Development >PHP Tutorial >急!!!Memcache::addserver() 最后一个参数,为什么我不管设置多少,都返回false

急!!!Memcache::addserver() 最后一个参数,为什么我不管设置多少,都返回false

WBOY
WBOYOriginal
2016-06-06 20:45:041004browse

<code>$mem = new Memcache;
$mem->addserver('127.0.0.1','11211',true,1,1,1,true,null,10000);
$a = $mem->set('key_arr1',array(1,1,5), 0, 0);
var_dump($a);
$val = $mem->get('key_arr1');
var_dump($val);
</code>

打印出来都是FALSE,但是下面两种连接方式,都是正常的,什么原因,有知道的吗?

<code>$mem->connect('127.0.0.1', 11211);
$mem->addserver('10.10.3.2','11211',true,1,0.2);
</code>

回复内容:

<code>$mem = new Memcache;
$mem->addserver('127.0.0.1','11211',true,1,1,1,true,null,10000);
$a = $mem->set('key_arr1',array(1,1,5), 0, 0);
var_dump($a);
$val = $mem->get('key_arr1');
var_dump($val);
</code>

打印出来都是FALSE,但是下面两种连接方式,都是正常的,什么原因,有知道的吗?

<code>$mem->connect('127.0.0.1', 11211);
$mem->addserver('10.10.3.2','11211',true,1,0.2);
</code>
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:PHP:采集程序Next article:ci2.1.4日志乱码,codeigniter