Date: 10/27/05 (PHP Community) Keywords: no keywords I'm trying to write a small script for a friend that will list all of the directories contained in a directory. My function currently looks like this: function displayDir($dir) { $dh = opendir($dir); while (false !== ($filename = readdir($dh))) { $files[] = $filename; } sort($files); echo " When I call the function like so displayDir(getcwd()); it displays all of the directories correctly. However when I try displayDir("test"); (test is a valid directory on my server which contains 11 other directories) is only reutrns back the . .. and one other directory. I've tried taking out the is_dir condition and it returns all of the files located in test just fine. Any idea what's up? Source: http://www.livejournal.com/community/php/359541.html
|