Php-Arrays function-array_intersect_uassoc-calculates the intersection of Arrays with an index check and compares indexes with a callback function. Array_intersect_uassoc () includes the intersection of the index checking and calculation arrays, and compares indexes with the callback function. [function] This function returns an array containing all the elements in array1 but in array_intersect_uassoc () checks and computes the intersection of arrays with indexes, and compares indexes with callback functions.
[Function]
This function returns an array,
This array contains all values in the array of array1 but not in any other parameter.
Note that, unlike the array_intersect () function, the key name is also used for comparison.
Scope of use]
Php5.
[Use]
Array array_intersect_assoc (array array1, array array2 [, array..., callback key_compare_func])
Array1/required/array 1
Array2/required/compared arrays must have at least one
Array.../optional/array for comparison
Key_compare_func.../optional/provides a standard callback function.
[Example]
[Php]
// Define two arrays respectively
$ Array1 = array ("blue" => 6, "red" => 2, "green" => 3, "purple" => 4 );
$ Array2 = array ("green" => 5, "blue" => 6, "yellow" => 7, "cyan" => 8 );
Print_r (array_intersect_uassoc ($ array1, $ array2, "strcasecmp "));
/*
Array
(
[Blue] => 6
)
*/
Taken from zuodefeng's note
The http://www.bkjia.com/PHPjc/478209.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/478209.htmlTechArticlearray_intersect_uassoc () carries the index check to calculate the intersection of the array, and compares the index with the callback function [function] This function returns an array that contains all in array1...