$images = find_images('/path/to/images'); foreach ($images as $image) { // Do something with each image filename }
$images = find_images('/path/to/images'); if (count($images) > 0) { echo 'This directory contains '.count($images).' images'; } else { echo 'No images found in this directory'; }
$images = find_images('/path/to/images', '/\.jpg$|\.png$/'); foreach ($images as $image) { // Do something with each matching image filename }This function is not part of any package library, as it is a built-in function in PHP.