Try this,

while ($file_name = readdir($dir2)) {

if ($file_name!="." && $file_name!=".." && $file_name!="head.jpg" && 
!ereg(^tn_,$file_name)) {
$files[]=$file_name; 
}
}
$numfiles = count($files);
for ($i=$g; $i<$numfiles; $i++){ 
echo $files[$i]; 
}

Tom

At 09:45 PM 7/14/01 -0400, you wrote:
>hi,
>
>I wanna print out all files in a directory. But i wanna exclude ".", "..",
>"head.jpg", and all files that start with tn_
>
>Here is my script, but it didn't work. Please help me to solve this problem.
>Thank You.
>
>---------my script-----
>while ($file_name = readdir($dir2))
>
>if (($file_name!="." && $file_name!=".." && $file_name!="head.jpg" &&
>$file_name!=ereg(^tn_,$file_name) ))
>
>$files[]=$file_name;
>}
>
>$numfiles = count($files);
>
>for ($i=$g; $i<$numfiles; $i++){
>echo $files[$i];
>}
>
>-----------------
>
>
>
>
>
>-- 
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to