function read_all ($dir){
if(!is_dir($dir)) return false;
$handle = opendir($dir);
if($handle){
while(($fl = readdir($handle)) !== false){
$temp = $dir.$fl;
//如果不加 $fl!=’.’ && $fl != ‘..’ 则会造成把$dir的父级目录也读取出来
if(is_dir($temp) && $fl!=’.’ && $fl != ‘..’){
echo ‘目录:’.$temp.'<br>’;
read_all($temp);
}else{
if($fl!=’.’ && $fl != ‘..’){
echo ‘文件:’.$temp.'<br>’;
$modifytime = filemtime($temp);
if($modifytime<(time()-86400)){
unlink($temp);
}
}
}
}
}
// return $arr;
}
php 清除一天前的文件
Warning: Use of undefined constant PRC - assumed 'PRC' (this will throw an Error in a future version of PHP) in /www/wwwroot/gaowenjie.cc/wp-content/themes/Git-alpha/comments.php on line 17