(PHP 5, PHP 7)
array_intersect_uassoc — 锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷慕锟斤拷锟斤拷锟斤拷没氐锟斤拷锟斤拷锟斤拷冉锟斤拷锟斤拷锟�
$array1
, array $array2
[, array $...
], callable $key_compare_func
) : array
array_intersect_uassoc() 锟斤拷锟斤拷一锟斤拷锟斤拷锟介,锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟�
array1
锟斤拷也同时锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟叫碉拷值锟斤拷注锟斤拷锟�
array_intersect() 锟斤拷同锟斤拷锟角硷拷锟斤拷也锟斤拷锟节比较★拷
array1
Initial array for comparison of the arrays.
array2
First array to compare keys against.
...
Variable list of array arguments to compare values against.
key_compare_func
锟节碉拷一锟斤拷锟斤拷锟斤拷小锟节o拷锟斤拷锟节伙拷锟斤拷诘诙锟斤拷锟斤拷锟斤拷锟绞憋拷锟斤拷帽冉虾锟斤拷锟斤拷锟斤拷锟斤拷锟接︼拷胤锟斤拷锟揭伙拷锟叫★拷冢锟斤拷锟斤拷诨锟斤拷锟斤拷 0 锟斤拷锟斤拷锟斤拷锟斤拷
Returns the values of array1
whose values exist
in all of the arguments.
Example #1 array_intersect_uassoc() 锟斤拷锟斤拷
<?php
$array1 = array("a" => "green", "b" => "brown", "c" => "blue", "red");
$array2 = array("a" => "GREEN", "B" => "brown", "yellow", "red");
print_r(array_intersect_uassoc($array1, $array2, "strcasecmp"));
?>
锟斤拷锟斤拷锟斤拷锟教伙拷锟斤拷锟斤拷锟�
Array ( [b] => brown )