💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
## rpoplpush (redis >= 1.1) ##### *Description* Pops a value from the tail of a list, and pushes it to the front of another list. Also return this value. 从源LIST的最后弹出一个元素,并且把这个元素从目标LIST的顶部(左侧)压入目标LIST。 ##### *Parameters* *Key*: srckey *Key*: dstkey ##### *Return value* *STRING* The element that was moved in case of success, `<span class="calibre12">FALSE</span>` in case of failure. ##### *Example* ``` <pre class="calibre9">$redis->delete('x', 'y'); $redis->lPush('x', 'abc'); $redis->lPush('x', 'def'); $redis->lPush('y', '123'); $redis->lPush('y', '456'); // move the last of x to the front of y. var_dump($redis->rpoplpush('x', 'y')); var_dump($redis->lRange('x', 0, -1)); var_dump($redis->lRange('y', 0, -1)); ``` Output: ``` <pre class="calibre9">string(3) "abc" array(1) { [0]=> string(3) "def" } array(3) { [0]=> string(3) "abc" [1]=> string(3) "456" [2]=> string(3) "123" } ``` ##