ARRAY_INTERSECT_ASSOC () The intersection of the computed array with an index check
"Function" The function returns an array,
The array contains all of the values in array1 but not in any other parameter array.
Note that unlike the Array_intersect () function, the key name is also used for comparison.
"Scope of Use"
php4>=4.3.0, PHP5.
Use
Array Array_intersect_assoc (array array1, array array2[,array ...])
array1/Required/Array 1
array2/required/Compared arrays must have at least one
Array.../Optional/used to compare the array
Example
[PHP]
Define two arrays separately
$array 1 = Array ("Blue" = 6, "Red" = 2, "green" = 3, "purple" = 4);
$array 2 = Array ("Green" =>5, "blue" = 6, "Yellow" = 7, "cyan" = 8);
Print_r (Array_intersect_assoc ($array 1, $array 2));
/*
Array
(
[Blue] = 6
)
*/
Excerpts from Zuodefeng's notes
http://www.bkjia.com/PHPjc/478207.html www.bkjia.com true http://www.bkjia.com/PHPjc/478207.html techarticle Array_intersect_assoc () with index check computes the intersection of an array "function" The function returns an array that contains all of the array1 but not in any other parameter array ...