Re: How to Detect File in a Specifc Directory on Window Env?
| From: | Johan Holst Nielsen | Date: | Fri, 19 Jul 2002 09:36:25 +0000 |
| Subject: | Re: How to Detect File in a Specifc Directory on Window Env? | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-108470@lists.php.net to get a copy of this message | ||
<?php
//DATEFORMAT YYYYMMDD
if($dir=@opendir("/yourdirwithpdf")) {
echo "Found following files:"
while(($file=readdir($dir))!==false) {
if(ereg("^[a-zA-Z0-9]+\.$INPUTDATE\.pdf")) {
echo '<a href="'.$file.'">'.$file.'<\n>';
}
}
}
?>
UPS
if(ereg("^[a-zA-Z0-9]+\.$INPUTDATE\.pdf", $file))
The ereg line should look like this :)
Regards,
Johan