## 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"
}
```
##
- php-redis中文帮助手册
- 系统及通用函数
- construct
- connect,open
- pconnect, popen
- close
- setOption
- getOption
- ping
- echo
- randomKey
- select
- move
- rename, renameKey
- renameNx
- setTimeout,expire,pexpire
- expireAt,pexpireAt
- keys,getKeys
- dbSize
- auth
- bgrewriteaof
- slaveof
- object
- save
- bgsave
- lastSave
- type
- flushDB
- flushAll
- sort
- info
- resetStat
- ttl, pttl
- persist
- config
- eval
- evalSha
- script
- getLastError
- _prefix
- _unserialize
- dump
- restore
- migrate
- time
- String数据类型函数
- get
- set
- setex, psetex
- setnx
- del, delete
- getSet
- multi, exec, discard
- watch, unwatch
- subscribe
- publish
- exists
- incr, incrBy
- incrByFloat
- decr, decrBy
- mGet, getMultiple
- append
- getRange
- setRange
- strlen
- getBit
- setBit
- bitop
- bitcount
- mset, msetnx
- List数据类型相关函数
- lPush
- rPush
- lPushx
- rPushx
- lPop
- rPop
- blPop, brPop
- lSize
- lIndex, lGet
- lSet
- IRange,IGetRange
- lTrim,listTrim
- lRem,lRemove
- lInsert
- rpoplpush
- brpoplpush
- Set数据类型相关函数
- sAdd
- sRem, sRemove
- sMove
- sIsMember, sContains
- sCard, sSize
- sPop
- sRandMember
- sInter
- sInterStore
- sUnion
- sUnionStore
- sDiff
- sDiffStore
- sMembers, sGetMembers
- zSet数据类型相关函数
- zAdd
- zRange
- zDelete,zRem
- zRevRange
- zRangeByScore, zRevRangeByScore
- zCount
- zRemRangeByScore,zDeleteRangeByScore
- zRemByRank,zDeleteRangeByRank
- zSize,zCard
- zScore
- zRank,zRevRank
- zIncrBy
- zUnion
- zInter
- Hash数据类型相关函数
- hSet
- hSetNx
- hGet
- hLen
- hDel
- hKeys
- hVals
- hGetAll
- hExists
- hIncrBy
- hIncrByFloat
- hMset
- hMGet