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

&& preg_match('/t\.jpg$/', $file) &&

Thanks mate (Y)

You may want to mark this thread as solved too.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.