在文件夹" scanner ()
"是否筛选," unlink ()
"我取消注册,如果删除文件夹中的文件,但我收到权限被拒绝错误:
Warning: unlink(path/.): Permission denied in unlink.php on line
Warning: unlink(path/..): Permission denied in unlink.php on line
我的unlink
php代码:
$Pscan = scandir("img/movieData/$m_folder/poster/");
foreach($Pscan as $Pscan_name){
unlink("img/movieData/$m_folder/poster/$Pscan_name");
}
答案 0 :(得分:0)
$Pscan = scandir("img/movieData/$m_folder/poster/");
foreach($Pscan as $Pscan_name){
// fixed
if($Pscan_name == '.' || $Pscan_name == '..'){
continue;
}else{
unlink("img/movieData/$m_folder/poster/$Pscan_name");
}
}