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_intersect($a1, $a2);
print_r($result);
?>

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

All Answers

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

(a).Array ( [a] => red [b] => green [c] => blue )

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