I'm running phpredis version 2.2.5 on an Amazon Linux EC2 server, and for a while was fiddling around in the console talking to Redis and everything was working fine.
Then, I plug in the PHP and start trying to have my code talk to the DB and that's when the trouble starts--every single value I add gets prepended with odd text, but the keys are okay.
I input the following code:
function subscribe($type,$value,$user) {
try {
$redis = newRedis();
$redis -> set("sub:$type:$value:$user","true");
$redis -> close();
} catch (Exception $e) {
$redis -> close();
return false;
}
}
with the goal of getting a key-value like "sub:chat:1:1" => "true". What I get instead is "sub:chat:1:1" => "s:4:\"true\";" when I read the redis DB in my console. What is going on here that it keeps changing this? I initially thought it was because I was passing integers to be the values, so I switched up the whole structure to pass text strings as a test, but the problem is still here.