array_intersect

(PHP 4 )

array_intersect -- SpoΦφtat pr∙nik polφ

Popis

array array_intersect ( array array1, array array2 [, array ...])

array_intersect() vracφ pole obsahujφcφ v╣echny hodnoty z array1, kterΘ se vyskytujφ ve v╣ech argumentech. KlφΦe jsou zachovßny.

P°φklad 1. Ukßzka array_intersect()

$array1 = array ("a" => "green", "red", "blue");
$array2 = array ("b" => "green", "yellow", "red");
$result = array_intersect ($array1, $array2);

$result obsahuje array ("a" => "green", "red");

Viz takΘ: array_diff().