给KEY设置一个生存周期,单位为毫秒。
Parameters
Key:将被销毁的KEY
integer:生命周期
Return value
BOOL: TRUE in case of success, FALSE in case of failure.
Example
$redis->set('x', 'php学习');
$redis->expire('x', 3000); // x will disappear in 3000 milliseconds.
sleep(5); // wait 5 seconds
$redis->get('x'); // will return `FALSE`, as 'x' has expired.