rename 命令/方法/函数

Description

Renames a key.

重命名一个KEY


Parameters

STRING: srckey, the key to rename.

STRING:源KEY,需要改名的KEY


STRING: dstkey, the new name for the key.

STRING:目标KEY,KEY的新名字


Return value

BOOL: TRUE in case of success, FALSE in case of failure.


Example

$redis->set('x', '42');

$redis->rename('x', 'y');

$redis->get('y');   // → 42

$redis->get('x');   // → `FALSE`