How can a combination of a regular array and an associative array be output in PHP?

To output a combination of a regular array and an associative array in PHP, you can use a loop to iterate over both arrays and display their elements. You can use a foreach loop to iterate over the regular array and access its elements directly, and then use a foreach loop with key-value pairs to iterate over the associative array and display both keys and values.

$regularArray = array("apple", "banana", "orange");
$associativeArray = array("fruit1" => "apple", "fruit2" => "banana", "fruit3" => "orange");

foreach ($regularArray as $value) {
    echo $value . "<br>";
}

foreach ($associativeArray as $key => $value) {
    echo $key . ": " . $value . "<br>";
}