I am following this guide to get started with Predis in PHP. In this guide, they have given the set() function to store key value pairs:
set()
Set method expect value to be string. Use json_encode() to save data.
Set
$redis->set('allRowsDataArray', json_encode($allRowsDataArray));
And use json_decode() to retrieve from Redis.
json_decode()
Redis