AI写作智能体 自主规划任务,支持联网查询和网页读取,多模态高效创作各类分析报告、商业计划、营销方案、教学内容等。 广告
## lSet ##### *Description* Set the list at index with the new value. 根据索引值设置新的VAULE ##### *Parameters* *key* *index* *value* ##### *Return value* *BOOL*`<span class="calibre12">TRUE</span>` if the new value is setted. `<span class="calibre12">FALSE</span>` if the index is out of range, or data type identified by key is not a list. 如果设置成功返回TURE,如果KEY所指向的不是LIST,或者索引值超出LIST本身的长度范围,则返回flase。 Iset函数更像是UPDATE或者EDIT的概念,而不是INSERT或者ADD的概念,顾只能在LIST本身的长度范围内,而不能超出。 ##### *Example* ``` <pre class="calibre9">$redis->rPush('key1', 'A'); $redis->rPush('key1', 'B'); $redis->rPush('key1', 'C'); /* key1 => [ 'A', 'B', 'C' ] */ $redis->lGet('key1', 0); /* 'A' */ $redis->lSet('key1', 0, 'X'); $redis->lGet('key1', 0); /* 'X' */ ```