note 13913 deleted from function.readdir by philip
| From: | philip@php.net | Date: | Fri, 08 Nov 2002 01:54:41 +0000 |
| Subject: | note 13913 deleted from function.readdir by philip | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-39115@lists.php.net to get a copy of this message | ||
well this is for people who have a bunch of word documents and pdf documents... who want to list
them and show the date modified or uploaded... this is good for people who have user manuals and
other important documents to show....
<?
$handle=opendir('.');
while (false!==($file = readdir($handle))) {
if ($file != "." && $file != ".." && $file !=
"index.phtml") {
$filename = str_replace("_"," ",$file);
$fTime = filemtime($file);
$today = getdate($fTime);
$month = $today['month'];
$mday = $today['mday'];
$year = $today['year'];
$filename = str_replace(".pdf","",$filename);
$filename = str_replace(".doc","",$filename);
echo "<li><b><a href=$file target=_blank>$filename</a></b>
-<font size=1> Last update on <font color=red>$month $mday,
$year</font></font></li><br>";
}
}
closedir($handle);
?>