Copy code The code is as follows:
/*Function array_map() function: multiple array callback function---apply the callback function to the units of the given array
* 1. Syntax: array array_map (callback callback , array arr1 [, array ...] )
* 2. Description: Returns an array that contains the
* units of all units in arr1 after the callback has been applied. The number of arguments accepted by callback should match the number of arrays passed to the array_map() function.
* 3. Notes:
* 3.1. When a multi-array callback function acts on an array, the key name of the original array will be retained, that is, the key name of the returned array is
* the key name applied to the given array
* 3.2. When the multi-array return function operates on two or more arrays, their lengths must be consistent, and the
* key names of the original multiple arrays will be ignored, and the numeric index will be uniformly assigned as the key name
*/
// Example of using a single array
$websites=array("g"=>"google","b"=>"baidu","y"=>"yahoo");
//Output the original array
echo "
"; <br>print_r($websites); <br>echo "";
"; <br>print_r($urls); <br>echo "";
"; <br>print_r($results); <br>echo "";
The operation effect is as follows:
The above introduces the instructions for using arraylist sorting php array_map array function, including the content of arraylist sorting. I hope it will be helpful to friends who are interested in PHP tutorials.