How can the foreach loop be modified to iterate through individual images in a multidimensional array instead of properties?

When iterating through a multidimensional array with a foreach loop in PHP, the loop will iterate through the outer array and access each inner array as a property. To iterate through individual images in a multidimensional array, you can nest another foreach loop within the outer loop to access each element of the inner array.

$images = array(
    array("image1.jpg", "image2.jpg"),
    array("image3.jpg", "image4.jpg"),
    array("image5.jpg", "image6.jpg")
);

foreach ($images as $innerArray) {
    foreach ($innerArray as $image) {
        echo $image . "<br>";
    }
}