Q:

What will be the output of the following PHP code?

0

What will be the output of the following PHP code?

<?php
$a1 = array("a"=>"red", "b"=>"green", "c"=>"blue", "d"=>"yellow");
$a2 = array("e"=>"red", "f"=>"green", "g"=>"blue");
$result = array_diff($a1, $a2);
print_r($result);
?>

  1. Array ( [d] => yellow )
  2. Array ( [c] => blue )
  3. Array ( [a] => red )
  4. Array ( [e] => yellow )

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

(a).Array ( [d] => yellow )

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now