I am using the code below to create an array of images. I'd love to be able to not add any images with -c.jpg
in the filename. How can I do this?
<?php
$jsarray = array();
$iterator = new DirectoryIterator(dirname("public/images/portfolio/all/"));
foreach ($iterator as $fileinfo) {
if ($fileinfo->isFile()) {
//filtering to exclude the color images
$jsarray[] = "'" . $fileinfo->getFilename() . "'";
}
}
$jsstring = implode(",", $jsarray);
?>
I'm using PHP5.