function filelist( $folder, $filename ) { $temp = array(); if ($handle = opendir("$folder")) { while (false !== ($file = readdir($handle))) { if ($file != "." && $file != "..") { $temp[] = $file; } } closedir($handle); } sort($temp);
$filename = explode(",", $filename); $max = sizeof($filename); $count=0
foreach ($temp as $value) { for ( $i=0 ; $i<$max ; $i++ ) { if ( eregi($filename[$i],$value) ){ echo $value."<br>"; $count++; } } } return $count; }
$chk = filelist("abc","88"); if ( $chk == 0 ) echo "999.jpg";
|