In the provided PHP code snippet, what improvements can be made to efficiently iterate through and output the data in a desired format?

The provided PHP code snippet uses nested loops to iterate through a multi-dimensional array, which can be inefficient and harder to manage. To improve efficiency and simplify the code, we can use PHP's `foreach` loop to iterate through the array and output the data in the desired format. This approach makes the code more readable and easier to maintain.

$data = [
    [
        'name' => 'John Doe',
        'age' => 30,
        'city' => 'New York'
    ],
    [
        'name' => 'Jane Smith',
        'age' => 25,
        'city' => 'Los Angeles'
    ]
];

foreach ($data as $person) {
    echo "Name: " . $person['name'] . ", Age: " . $person['age'] . ", City: " . $person['city'] . "\n";
}