How can I display a multidimensional array in PHP?

To display a multidimensional array in PHP, you can use nested loops to iterate over each dimension of the array and print out the values. You can use a combination of foreach loops and keys to access the elements of the array. By using proper formatting and indentation, you can display the multidimensional array in a structured and readable format.

// Sample multidimensional array
$multiArray = array(
    array("John", "Doe"),
    array("Jane", "Smith"),
    array("Alice", "Johnson")
);

// Loop through the multidimensional array and display the values
foreach ($multiArray as $innerArray) {
    foreach ($innerArray as $value) {
        echo $value . " ";
    }
    echo "<br>";
}