array_intersect_uassoc() - 语法
array_intersect_uassoc($array1, $array2 [, $array3 ..., callback $key_compare_func] );
它返回一个数组,其中包含所有参数中存在的array1的所有值。
| Sr.No |
Parameter & Description |
| 1 |
array1(必需)
第一个数组是将与其他数组进行比较的数组。
|
| 2 |
array2(必需)
这是要与第一个数组进行比较的数组
|
| 3 |
array3(可选)
这是要与第一个数组进行比较的数组
|
| 4 |
Key_Compare_func(必需)
用户定义的回调函数。
|
array_intersect_uassoc() - 返回值
它返回一个数组,其中包含所有参数中存在的array1的所有值。
array_intersect_uassoc() - 示例
<?php
$input1=array("a" => "green", "b" => "brown", "c" => "blue", "red");
$input2=array("a" => "GREEN", "B" => "brown", "yellow", "RED");
result</span><spanclass="pun">=</span><spanclass="pln">arrayintersectuassoc</span><spanclass="pun">(</span><spanclass="pln">input1, input2</span><spanclass="pun">,</span><spanclass="pln"></span><spanclass="str">"strcasecmp"</span><spanclass="pun">);</span><spanclass="pln">printr</span><spanclass="pun">(</span><spanclass="pln">result);
?>
这将产生以下输出-
Array ( [b] => brown )
<h2 id="h22">参考链接</h2><p><a target="_blank" href="https://www.learnfk.com/php/php-function-array-intersect-uassoc.html" style="">https://www.learnfk.com/php/php-function-array-intersect-uassoc.html</a></p>