我有一個名爲client_images
的目錄,它有dir_1
,dir_2
和dir_3
作爲子目錄。當我運行以下命令:爲什麼scandir()爲目錄返回false?
foreach(scandir("client_images") as $key => $value){
if(is_dir($value)){
echo $value." is a dir.<br>";
}
else{
echo $value." is not a dir.<br>";
}
}
我得到:
. is a dir. .. is a dir. dir_1 is not a dir. dir_2 is not a dir. dir_3 is not a dir.
爲什麼PHP返回false的目錄?
謝謝,那麼如何檢查裏面client_images迪爾斯? – Babiker 2011-04-02 04:59:57
將''client_images /「'(或Windows相當於)傳遞給'is_dir()'的路徑。 – geekosaur 2011-04-02 05:01:33