Consider following code snippet:
$a = array(1, 3, 5);
$b = array(2, 4, 6);
$b += $a;
What elements will have $b array after executing the code above?
Explanation
The + operator returns the right-hand array appended to the left-hand array; for keys that exist in both arrays, the elements from the left-hand array will be used, and the matching elements from the right-hand array will be ignored.

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback
Keep exploring
PHP quizzes
Cosmo
Sign Up Now
or Subscribe for future quizzes