假设我将这些变量保存在cache_lite中:
article_1_0
article_1_1
article_3_2
article_3_3
article_2_4
如何删除以article_3_开头的所有缓存变量(最多可以达到10000)?
或者换句话说,我如何列出缓存的变量??
答案 0 :(得分:2)
尝试通过指定组值来保存cache_lite变量,然后尝试通过指定该组值来清除它 即:
$cache->save($dataarticle_1_0,"article_1_0","article_1");
$cache->save($dataarticle_1_1,"article_1_1","article_1");
$cache->save($dataarticle_3_2,"article_3_2","article_3");
$cache->save($dataarticle_3_3,"article_3_3","article_3");
$cache->save($dataarticle_2_4,"article_2_4","article_2");
然后删除以article_3_开头的所有缓存变量,你可以这样做
$cache->clean("article_3");
希望这是解决方案