DarkRanger Posted May 20, 2011 Share Posted May 20, 2011 Hi hi, CAn anyone tell me why this piece of code doesn't work? <?php function readDirs($main){ $dirHandle = opendir($main); while($file = readdir($dirHandle)){ if(is_dir($file) && $file != '.' && $file != '..'){ readDirs($file); } else{ echo $file . '<br/>'; } } } $dir = '../../lib'; readDirs($dir); ?> It must show all the files in the directory, but only shows: . .. technical Quote Link to comment https://forums.phpfreaks.com/topic/236930-directory-scan-snippet-problem/ 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.