09-03-2009, 08:26 AM
|
|
Confirmed User
Industry Role:
Join Date: Jun 2004
Location: Europe
Posts: 3,055
|
Quote:
Originally Posted by quantum-x
This will do the trick.
PHP Code:
<?
foreach(globr('/path/to/dirname/','*pix*') as $v) unlink($v);
function globr($sDir, $sPattern, $nFlags = NULL) {
$sDir = escapeshellcmd($sDir);
$aFiles = glob("$sDir/$sPattern", $nFlags);
foreach (glob("$sDir/*", GLOB_ONLYDIR) as $sSubDir)
{
$aSubFiles = globr($sSubDir, $sPattern, $nFlags);
$aFiles = array_merge($aFiles, $aSubFiles);
}
return $aFiles; }
?>
|
thanks man.
|
|
|