今天同事需要清理memcache中某種前綴的key的值,但memcache沒有專門的這種命令,我幫忙在網上找了一段程序:
How about this function in php:
function deletekeysbyindex($prefix) {
$m = new Memcached();
$m->addServer('localhost', 11211);
$keys = $m->getAllKeys();
foreach ($keys as $index => $