首页 > php函数 > php array_intersect_ukey()函数使用方法

php array_intersect_ukey()函数使用方法

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

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

语法

array_intersect_ukey(array1,array2,array3...,function)
ParameterDescriptionarray1Required. The first array is the array that the others will be compared witharray2Required. An array to be compared with the first arrayarray3Optional. An array to be compared with the first arrayfunctionRequired. The name of the user-made function
提示和说明提示:您可以比较的第一个阵列一个阵列,或有你喜欢。 注意:只有钥匙必须同时获得一场比赛,无论是在自动对比和用户定义的函数。 范例1 <?php
function myfunction($v1,$v2) 
{
if ($v1===$v2)
	{
	return 0;
	}
if ($v1>$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 )



本文地址:http://www.phprm.com/function/4290ba5b504e97d8cbf1ff38ad38fa94.html

转载随意,但请附上文章地址:-)

标签:none

发表留言