0

Hey,

I have the following script...

if(!opendir($image_dir)){
	echo info_msg("Ooops... This Album contains no images");	
}else{
		
/* step one:  read directory, make array of files */
if ($handle = opendir($image_dir)) {
while (false !== ($file = readdir($handle))) 
{
if ($file != '.' && $file != '..' && preg_match("/t/",$file) && $file != '_notes' && $file != 'album_cover.jpg' && $file != 'preview.jpg' && $file != '.DS_Store') 
{
$files[] = $file;
}
}
closedir($handle);
}

However its not working how I want it to...
I ONLY want it to count any files the END in t.jpg

so I if I have
001.jpg
001t.jpg

It will only see the file with the t.jpg

Can anyone help?

Dan

2
Contributors
3
Replies
4
Views
6 Years
Discussion Span
Last Post by pritaeas
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.