9951 explained code solutions for 126 technologies


php-redisHow to delete keys matching pattern


$redis->delete($redis->keys('pref*'));ctrl + c
$redis

Redis object after connection

delete

deletes specified keys

keys

returns keys that match selected pattern

'pref*'

patter to match keys for deletion (in our case: keys starting with pref...)