zAdd
Description
Adds the specified member with a given score to the sorted set stored at key.
增加一个或多个元素,如果该元素已经存在,更新它的socre值
虽然有序集合有序,但它也是集合,不能重复元素,添加重复元素只会
更新原有元素的score值
Parameters
key
score : double
value: string
Return value
Long 1 if the element is added. 0 otherwise.
Example
$redis->zAdd('key', 1, 'val1'); $redis->zAdd('key', 0, 'val0'); $redis->zAdd('key', 5, 'val5'); $redis->zRange('key', 0, -1); // array(val0, val1, val5)