PHP
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

array_intersect_ukey> <array_intersect_key
Last updated: Mon, 26 Nov 2007

view this page in

array_intersect_uassoc

(PHP 5)

array_intersect_uassoc — 带索引检查计算数组的交集,用回调函数比较索引

说明

array array_intersect_uassoc ( array $array1 , array $array2 [, array $ ... ], callback $key_compare_func )

array_intersect_uassoc() 返回一个数组,该数组包含了所有在 array1 中也同时出现在所有其它参数数组中的值。注意和 array_intersect() 不同的是键名也用于比较。

此比较是通过用户提供的回调函数来进行的。如果认为第一个参数小于,等于,或大于第二个参数时必须分别返回一个小于零,等于零,或大于零的整数。

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
)

参见 array_intersect()array_intersect_assoc()array_uintersect_assoc()array_uintersect_uassoc()array_intersect_key()array_intersect_ukey()



add a note add a note User Contributed Notes
array_intersect_uassoc
There are no user contributed notes for this page.

array_intersect_ukey> <array_intersect_key
Last updated: Mon, 26 Nov 2007
 
 
show source | credits | sitemap | contact | advertising | mirror sites