我想设置memcache到期31天使用PHP代码时间()+ 3600 * 24 * 31,但它不起作用

时间:2017-10-02 04:23:31

标签: php memcached

<?php
$mem = new Memcache();
$flag = $mem -> connect('localhost',11211);

$mem -> set('color','red',0,30);//
$mem -> set('age',23,0,time()+30);//this code does not work because of "time()"

代码时间()不起作用

我的代码运行结果。

the result of my code run

1 个答案:

答案 0 :(得分:0)

从Redis更新到Memcache,

  

$ mem - &gt; set('color','red',0,31 * 60 * 60 * 24);

根据文档,

http://php.net/manual/en/memcache.set.php

希望它有所帮助。