function actionZmdel()
{
//set_time_limit(0);
$dir = dirname(dirname(dirname(dirname(__FILE__)))).'/2012jxgwyimg';
$dirarr = scandir($dir);
echo '正在删除...';
foreach($dirarr as $subdir)
{
if($subdir != '.' && $subdir != '..')
{
$path = $dir.'/'.$subdir;
$files = glob($path.'/*.jpg');
foreach($files as $file)
{
if(filesize($file) >= 0 && filesize($file) <700)
{
//echo $file.'<br>';
@unlink($file);
}
}
}
}
sleep(5);
return $this->_redirectMessage(
'提示',
'正在删除。',
url('default/zmdel'));
exit();
}
php删除指定大小的jpg文件
猜你喜欢
转载自blog.csdn.net/ilwtfqqc/article/details/97889075
今日推荐
周排行