无涯教程-PHP - array_uintersect_assoc()函数

44 阅读1分钟

array_uintersect_assoc() - 语法

array_uintersect_assoc( $array1, $array2 [, $array3 ..., $data_compare_func] );

此函数返回一个数组,其中包含所有参数array2、array3中存在的array1的所有值。

Sr.No Parameter & Description
1

array1(必需)

它指定一个数组。

2

array2(必需)

它指定要与第一个数组进行比较的数组。

3

array3(可选)

它指定要与第一个数组进行比较的数组。

4

Data_Compare_func(必需)

用户自定义函数的名称。

array_uintersect_assoc() - 示例

<?php
   $input1=array("a"=>"green", "b"=>"brown", "c"=>"blue", "red");
   $input2=array("a"=>"GREEN", "B"=>"brown", "yellow", "red");

print_r(array_uintersect_assoc(input1</span><spanclass="pun">,</span><spanclass="pln">input1</span><span class="pun">,</span><span class="pln"> input2, "strcasecmp")); ?>

这将产生以下输出-

Array ( [a] => green )
        <h2 id="h22">参考链接</h2><p><a target="_blank" href="https://www.learnfk.com/php/php-function-array-uintersect-assoc.html" style="">https://www.learnfk.com/php/php-function-array-uintersect-assoc.html</a></p>