代潇瑞博客

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`

【相关命令】

触屏版 | 电脑版

Copyright © 2013 代潇瑞博客手机版

QQ: 446673330

粤ICP备13071969号-1