Q14
What will be the output of the following PHP code? "red", "b" => "green", "c" => "blue", "d" => "yellow"); a2 = array("e" => "red", "f" => "green", "g" => "blue", "h" => "orange"); a3 = array("i" => "orange"); a4 = array_combine( a2, a3); result = array_diff( a4, a2); print_r( result); ?>
A.
Array ( [d] => yellow )
AnswerB.
Array ( [i] => orange )
C.
Array ( [h] => orange )
D.
Array ( [d] => yellow [h] => orange )
Answer: Option A
Solution
Answer: Option A
Solution:
The array_diff() function compares the values of two (or more) arrays, and returns the differences.