directory reading
Posted: Tue Oct 10, 2006 4:36 am
How to read all the files in a directory.I want the output sorted according to the filedate
A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
Code: Select all
<?php
$handle = opendir("yourpath");
while ($file = readdir($handle))
{
if($file != "." && $file != "..") // to omit . and .. from the directory
$gallery[] = $file;
}
sort($gallery);
foreach($gallery as $value)
echo "$value<br>";
?>