These 5 functions for obtaining the intersection have 5 corresponding functions for obtaining the difference set. I am the link. array_intersect($arr1, $arr2); //Get the intersection of the same key value in the array array_intersect_key($arr1, $arr2); //Get the intersection of arrays with the same key name array_intersect_assoc(same as above); //Get the intersection of the key values of the array with the same key name array_intersect_uassoc(same as above, 'custom callback function'); //Use a custom callback function to obtain the intersection of the key values of the array with the same key name array_intersect_ukey (same as above, custom callback function); //Use a custom callback function to obtain the intersection of data with the same key name 1 $arr1 = array('r' => 'red','u' => 'blue'
1. Detailed introduction to the array_intersect_ukey function
##Introduction: These 5 functions for obtaining the intersection have 5 corresponding functions for obtaining the difference set. I am a link. array_intersect($arr1, $arr2);//Get the intersection of arrays with the same key value array_intersect_key($arr1, $arr2);//Get the intersection of the array with the same key name array_intersect_assoc (same as above);//Get the array with the same key name key value The intersection of array_intersect_uassoc (same as above, 'custom...
2. Android programmers learn PHP development (23) - array operation related functions (1) key name key value Chapter - PhpStorm
## Introduction: There are also examples in the PHP manual, but individual functions have PHP versions to use. Restrictions, some functions also have restrictions on value~These are written in the code below~
3.
How to reset the array key name and key value
Introduction: How to reset the array key name and valueThe above is the detailed content of Summarize the key points to note about key names and key values. For more information, please follow other related articles on the PHP Chinese website!