rPop

PHP Redis

rPop

Description

Returns and removes the last element of the list.

返回LIST底部(右侧)的VALUE,并且从LIST中把该VALUE弹出。

Parameters

key

Return value

STRING if command executed successfully BOOL FALSE in case of failure (empty list)

取得VALUE成功,返回TURE。如果是一个空LIST则返回FLASE。

Example
$redis->rPush('key1', 'A');
$redis->rPush('key1', 'B');
$redis->rPush('key1', 'C'); /* key1 => [ 'A', 'B', 'C' ] */
$redis->rPop('key1'); /* key1 => [ 'A', 'B' ] */