9951 explained code solutions for 126 technologies


php-redisSet key expiration in Redis


$redis->setex('key', 30, 'test');ctrl + c
$redis

Redis object after connection

setex

set key value along with expiration in seconds

key

name of the key

30

seconds after which key will expire

test

value of the key