archives

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
techker
Forum Commoner
Posts: 52
Joined: Fri Sep 02, 2005 9:53 pm

archives

Post by techker »

hello again..im making an archives section.i need to know if there is a scripts that could show the files in one folder?

lets say you go on archives.php on that page you see the content in an archive folder.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

you could easily make your own: glob()
User avatar
Joe
Forum Regular
Posts: 939
Joined: Sun Feb 29, 2004 1:26 pm
Location: UK - Glasgow

Post by Joe »

Code: Select all

<?php
$dir = ""; //Dir name

if ($filehandle = opendir($dir)) {
  while (false !== ($filename = readdir($filehandle))) {
     if ($filename != "." && $filename != "..") {
        echo "$filename \n";
     }
   }
 closedir($filehandle);
}
?>
techker
Forum Commoner
Posts: 52
Joined: Fri Sep 02, 2005 9:53 pm

Post by techker »

nice i will try it out.
Post Reply