AI写作智能体 自主规划任务,支持联网查询和网页读取,多模态高效创作各类分析报告、商业计划、营销方案、教学内容等。 广告
## zRange ##### *Description* Returns a range of elements from the ordered set stored at the specified key, with values in the range \[start, end\]. start and stop are interpreted as zero-based indices: 0 the first element, 1 the second ... -1 the last element, -2 the penultimate ... 取得特定范围内的排序元素,0代表第一个元素,1代表第二个以此类推。-1代表最后一个,-2代表倒数第二个... ##### *Parameters* *key* *start*: long *end*: long *withscores*: bool = false ##### *Return value* *Array* containing the values in specified range. ##### *Example* ``` <pre class="calibre16">$redis->zAdd('key1', 0, 'val0'); $redis->zAdd('key1', 2, 'val2'); $redis->zAdd('key1', 10, 'val10'); $redis->zRange('key1', 0, -1); /* array('val0', 'val2', 'val10') */ // with scores $redis->zRange('key1', 0, -1, true); /* array('val0' => 0, 'val2' => 2, 'val10' => 10) */ ``` ##