please see my comments in this code for my questions… thank you…
if (is_dir($FPathPhotos)) {
if ($dh = opendir($FPathPhotos)) {
foreach(glob($FPathPhotos."*.jpg") as $filename) {
$fileName = basename($filename);
echo 'file name -- ' . $fileName . '<br>';
if (checkPhotoName($fileName)) {
echo 'YES -- ' . $fileName . '<br>';
} else {
echo 'NO -- ' . $fileName . '<br>';
unset($fileName); // is this an ok way to remove bad filenames?
}
echo 'fileName AFTER FILTERING -- ' . $fileName . '<br>'; // works -- prints only files whose names check..
// I need count of files AFTER FLENAME FILTERING... how do I get this?
}
}
}
this did not work… used a standard loop to print filenames in new $filesAfterFiltering array, but nothing would print… so I opted for removing bad filenames instead… but now find I can’t get count of files after filtering filenames… yikes…
thank you…
*actually in java you can’t dynamically add elements to an array, have to use Vector and then convert to array… beside the point, but just to clarify…