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 Link to comment https://forums.phpfreaks.com/topic/236930-directory-scan-snippet-problem/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.