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
techker
Forum Commoner
Posts: 52 Joined: Fri Sep 02, 2005 9:53 pm
Post
by techker » Fri Sep 09, 2005 7:27 am
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.
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Fri Sep 09, 2005 8:35 am
you could easily make your own:
glob()
Joe
Forum Regular
Posts: 939 Joined: Sun Feb 29, 2004 1:26 pm
Location: UK - Glasgow
Post
by Joe » Fri Sep 09, 2005 9:39 am
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 » Fri Sep 09, 2005 6:51 pm
nice i will try it out.