cloudx575
10-12-2003, 10:42 PM
how would i display all the files with a .html extension in a certain folder without making an array or anything like that, just a list of every html file in that folder
|
Click to See Complete Forum and Search --> : files in folder cloudx575 10-12-2003, 10:42 PM how would i display all the files with a .html extension in a certain folder without making an array or anything like that, just a list of every html file in that folder pyro 10-12-2003, 11:08 PM You could try something like this to display all .htm and .html files: <?PHP $folder = "/root/path/to/currentdirectory/"; $handle = opendir($folder); while ($file = readdir($handle)) { if (preg_match("/\.htm(l)?$/", $file)) { echo "<a href=\"$file\">$file</a><br>"; } } closedir($handle); ?> webdeveloper.com
Copyright Internet.com Inc., All Rights Reserved. |