March 2002
Intermediate to advanced
528 pages
21h 29m
English
array_map
array array_map(mixedcallback, arrayarray1[, ... arrayarrayN])
Creates an array by applying the callback function referenced in the
first parameter to the remaining parameters; the callback function
should take as parameters a number of values equal to the number of
arrays passed into array_map( ). For example:
function multiply($inOne, $inTwo) {
return $inOne * $inTwo;
}
$first = (1, 2, 3, 4);
$second = (10, 9, 8, 7);
$array = array_map("multiply", $first, $second); // contains (10, 18, 24, 28)