Trying to list all folders in a directory with PHP, need help…
-
Heya,
I’m trying to list only the folders in this directory but as soon as I add the is_dir($file) it lists nothing. If I remove it it will list files and directories. Can someone help? Thanks!if ($handle = opendir('../wp-content/plugins/tpc-slideshow/themes')) { while (false !== ($file = readdir($handle))) { if( $file != '.' && $file != '..' && is_dir($file) ) { echo "<p>$file</p>"; } } closedir($handle); }
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Trying to list all folders in a directory with PHP, need help…’ is closed to new replies.