Hi guys
I am trying to get a count of certain images i have in a folder.
Images are as soon 1_thumb to 12.jpg, 1_main to 12.jpg, 1_popup to 12.jpg
Actually named: 1_thumb.jpg and so on…
I am using the code from the php help manual
if ($handle = opendir('../media/models/'.$_GET['model_id']."/model_pics")) {
$i=0;
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != ".." && $file != substr_count($file, '_main.jpg') && $file != substr_count($file, '_popup.jpg')) {
$i++;
}
}
echo "&retval=1&imageCount=".$i;
closedir($handle);
}
Image count is retuned as 34 but it should be 12.
Anyone?
Thanks