redis 查找批量相同前缀的键值操作

2020-01-10

PHP redis php

image

PHP 使用示例:

$redis = new Redis();
$iterator = null;

while ($keys = $redis->scan($iterator, "key*")) {
    foreach ($keys as $key) {
        $redis->del($key);//删除键值
    }
}