9951 explained code solutions for 126 technologies


php-redisRedis getset usage example


$previous = $redis->getset('a', 25);ctrl + c
$redis

Redis object after connection

$previous

will be set to previous value of a key

getset

returns current key value and sets new value after that

'a'

name of the key to getset

25

new value to set