9951 explained code solutions for 126 technologies


php-redisSave nested JSON to Redis key


$json = ['name' => 'Donald', 'top' => [1, 2, 3]];
$redis->set('js', json_encode($json));ctrl + c
$json

sample nested JSON to store to Redis

$redis

Redis object after connection

set

save string value to the specified Redis key

json_encode

converts associative array to JSON string

'js'

name of the Redis key to store JSON string to