directory reading
Moderator: General Moderators
-
santosh1234
- Forum Newbie
- Posts: 1
- Joined: Tue Oct 10, 2006 4:29 am
directory reading
How to read all the files in a directory.I want the output sorted according to the filedate
-
satheshf12000
- Forum Commoner
- Posts: 25
- Joined: Mon Sep 04, 2006 5:38 pm
I think this is what u need..
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>";
?>