9951 explained code solutions for 126 technologies


php-redisGet array from Redis


The best way to store to and get arrays from Redis is to use Redis lists:

$redis->lrange('list2', 0, -1)ctrl + c
lrange

returns specified elements from the list

list2

name of the key to get array from (should be a Redis list)

0, -1

offset and limit to use for the elements (0, -1 - get all elements from start)