Peuplarchie Posted March 1, 2010 Share Posted March 1, 2010 Good day, I'm working on a script and this script list folder in a html list. Here is the code; <html> <head> <style type="text/css"> ul { list-style-image: url(Icons/box_icon.png); } li li { list-style-image: url('Icons/open_book_icon.jpg'); } li li li { list-style-image: url('Icons/gallery.gif'); } </style> </head> <body> <?PHP function globDir($dir) { $files = glob("$dir/*", GLOB_ONLYDIR); if(!empty($files)) { echo "<ul>\n"; foreach($files as $file) { echo "<li>"; echo "<b>". basename($file)."</b>\n"; globDir($file); echo "</li>\n"; } echo "</ul>\n"; } } globDir('Photos'); ?> </body> </html> example folder | - Folder 1 - Folder 2 | - Folder2.1 | - Folder3 The deal here is that I could go by CSS level of list but my problem is that sometime there is more subfolder yhat this example. Is there a way that I can tell the last level folder to be written in bold ? Thanks ! Link to comment https://forums.phpfreaks.com/topic/193734-determine-if-this-folder-is-the-last-level-within-that-folder/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.