damerit Posted January 22, 2009 Share Posted January 22, 2009 This is part of a common free GPL sitemp.php file and I am trying to modify it so that I can only list the folder if it has a .html extension. I have hundreds of folders and I don't want to display all of them nor exclude each one. Can I get some pointers or ideas? $display['html'] = "html.gif"; $excludedir[] = ""; $excludefile[] = ""; while ($file = readdir($handle)) { if(is_dir($file) && $file != "." && $file != ".." && !in_array($file, $excludedir)) { $sdirs[] = $file; } elseif(is_file($file) && $file != "$self" && array_key_exists(get_extension($file), $display) && !in_array($file, $excludefile)) { $sfiles[] = $file; } } Link to comment https://forums.phpfreaks.com/topic/141982-sitemap-exclude-directory-if-no-html-file-exist/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.