* Thus wrote Don Myers ([EMAIL PROTECTED]):
> PHP gurus. I know this can be made shorter but I can't seem to figure out
> how.
> 
> This is a PHP CLI script I use to go through a directory listing a act upon
> file matching the same prefix and/or suffix if supplied. This is the code I
> use now.
> 
> // set up the prefix and/or suffix if I want to match on certain files
> $deleteprefix = "";
> $deletesuffix = "";
> 

$match = "$deleteprefix*$deletesuffix";

foreach (glob($rootpath.$match) as $file) {
  logger("Deleted: ".$file." Last Modified: ".date("F j, 
Y",filemtime($rootpath.$file)));
  unlink($rootpath.$file);
}


Curt
-- 
"I used to think I was indecisive, but now I'm not so sure."

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to