Re: How to Detect File in a Specifc Directory on Window Env?

From: 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:
<?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 :)
Wow, I also forgot to close the dir handle! Well I will let you do that :) Regards, Johan

« previous php.general (#108472) next »