How can the issue of displaying multiple images instead of just the highest one be resolved in PHP?

Issue: The problem of displaying multiple images instead of just the highest one can be resolved by using a loop to iterate through all the images and display each one. PHP Code Snippet:

<?php
$images = array("image1.jpg", "image2.jpg", "image3.jpg");

foreach($images as $image) {
    echo "<img src='$image' alt='Image'>";
}
?>