How can the PHP code provided be modified to output the customer address data in a vertical format rather than a horizontal one?

To output the customer address data in a vertical format rather than a horizontal one, you can iterate over the address array and echo each element on a new line. This can be achieved by using a foreach loop to iterate over the address array and echo each key-value pair on a separate line.

<?php
$customer = [
    'name' => 'John Doe',
    'address' => [
        'street' => '123 Main Street',
        'city' => 'Anytown',
        'state' => 'CA',
        'zip' => '12345'
    ]
];

echo "Customer Name: " . $customer['name'] . "<br>";
echo "Customer Address:<br>";
foreach ($customer['address'] as $key => $value) {
    echo $key . ": " . $value . "<br>";
}
?>