一聚教程网:一个值得你收藏的教程网站

热门教程

php array_intersect_ukey()函数使用方法

时间:2022-07-02 10:03:38 编辑:袖梨 来源:一聚教程网

好了下面我们来看看php array_intersect_ukey()函数使用方法与实例教程吧.

array_intersect_ukey()定义和用法
该array_intersect_ukey ( )函数比较的钥匙在两个或两个以上的阵列,检查比赛之前,比较的钥匙在一个用户定义的函数,然后返回一个数组的项和值从第一个数组,如果该功能允许它。

语法

array_intersect_ukey(array1,array2,array3...,function)
ParameterDescription
array1Required. The first array is the array that the others will be compared with
array2Required. An array to be compared with the first array
array3Optional. An array to be compared with the first array
functionRequired. The name of the user-made function

提示和说明
提示:您可以比较的第一个阵列一个阵列,或有你喜欢。

注意:只有钥匙必须同时获得一场比赛,无论是在自动对比和用户定义的函数。




范例1

 

$v2)
	{
	return 1;
	}
else
	{
	return -1;
	}
}
$a1=array(0=>"Dog",1=>"Cat",2=>"Horse");
$a2=array(3=>"Rat",1=>"Bird",5=>"Monkey");
print_r(array_intersect_ukey($a1,$a2,"myfunction"));
?>
输出结果.
 
Array ( [] => Cat )

热门栏目