del, delete

PHP Redis

del, delete

Description

Remove specified keys.

移除已经存在KEYS

Parameters

An array of keys, or an undefined number of parameters, each a key: key1 key2 key3 ... keyN

可以是一个KEYS的数组,或者一个未定义的数字参数,或者一个一个的写KEY

Return value

Long Number of keys deleted.

返回删除KEY-VALUE的数量

Examples
$redis->set('key1', 'val1');
$redis->set('key2', 'val2');
$redis->set('key3', 'val3');
$redis->set('key4', 'val4');

$redis->delete('key1', 'key2'); /* return 2 */
$redis->delete(array('key3', 'key4')); /* return 2 */