9951 explained code solutions for 126 technologies


php-redisUsing Lua scripts in Redis


Let's execute LUA script that sets and then gets value from Redis:

$redis->eval("redis.call('set', 'l1', 'hi'); return redis.call('get', 'l1');");ctrl + c
$redis

Redis object after connection

eval

evaluates specified LUA code

redis.call

LUA interface to call Redis methods