0
<?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()"

code time() which does not work

the result of my code run.

the result of my code run

Micho
  • 3,929
  • 13
  • 37
  • 40
lian duan
  • 1
  • 1

1 Answers1

0

Updated from Redis to Memcache,

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

Based on the documentation,

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

Hope it helps.

Kannaiyan
  • 12,554
  • 3
  • 44
  • 83