fork download
  1. <?php
  2. $array1 = array("a" => "verde", "vermelho", "azul");
  3. $array2 = array("b" => "verde", "amarelo", "vermelho");
  4. $result = array_intersect($array1, $array2);
  5. print_r($result);
  6. ?>
Success #stdin #stdout 0.01s 82560KB
stdin
Standard input is empty
stdout
Array
(
    [a] => verde
    [0] => vermelho
)