mojito Posted February 1, 2007 Share Posted February 1, 2007 inside admin directory is a folder called "hh" and a file callled admin.php both are being seen by the script below but "hh" is not being recognised as a folder with is_dir comming out as false ??? $dir="./admin/"; openFolder(); function openFolder () { clearstatcache() ; global $dir; if (is_dir($dir)) { //open catalog $open = opendir($dir); //check every file while (false !== ($file = readdir($open))) { var_dump (is_dir($file)); echo $file; } } } Quote Link to comment Share on other sites More sharing options...
snowrhythm Posted February 1, 2007 Share Posted February 1, 2007 you had "while (false !== ($file = readdir($open))) ..." in your code there, is "!==" valid? shouldn't it be just "!=" ? Quote Link to comment Share on other sites More sharing options...
Jessica Posted February 1, 2007 Share Posted February 1, 2007 !== checks the type as well as the value, that's fine. Quote Link to comment Share on other sites More sharing options...
snowrhythm Posted February 1, 2007 Share Posted February 1, 2007 sweet...learned something new today Quote Link to comment Share on other sites More sharing options...
mojito Posted February 1, 2007 Author Share Posted February 1, 2007 seems the full directory path works more reliably, when I thought code either worked or didnt! so where I had simply $file $dir.$file gives me the correct answer. thanks and welcome any more interest. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.