<<< Previous question <<< Question ID#0071.md >>> Next question >>>
What will be the output of the PHP script given below?
$array1 = array("orange", "banana", "apple", "raspberry");
$array2 = array(0 => "pineapple", 4 => "cherry");
$array3 = array(0 => "grape");
$array4 = array_replace($array1, $array2, $array3);
print_r($array4);
- A)
Array ( [0] => grape [1] => banana [2] => apple [3] => raspberry [4] => cherry )
- B)
Array ( [0] => orange [1] => banana [2] => apple [3] => raspberry [4] => cherry )
- C)
Array ( [0] => orange [1] => banana [2] => apple [3] => raspberry [4] => grape )
- D)
Array ( [0] => banana [1] => cherry [2] => grape )
Answer
Answer: A