1、<?php
header("Content-type: text/html; charset=utf-8");
function clearCache($dir){
$file = scandir($dir);
foreach($file as $v){
if($v == 'clear.php'){continue;}
if(@unlink($v)){
echo "成功删除文件:".$v.'<br />';
} else {
echo "删除缓存文件失败:".$v.'<br />';
}
}
}
clearCache(dirname(__FILE__));
如图:
