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