array_map : Very useful function hi all, Applies the callback to the elements of the given array.
we can apply user defined function in each
element of an array by this function.
Eg:
we can change all values to lower string an array by array_map function
here example for that..
$inputarray = array("Hello","Buy It");
function funStrChange($pmArray)
{
return strtolower($pmArray);
}
$aResult = array_map("funStrChange", $inputarray);
now, $aResult is:
$aResult[0] = "hello";
$aResult[1] = "buy it"; |