View Single Post
  #4  
Old 08-14-2007, 12:24 AM
raj raj is offline
D-Web Programmer
 
Join Date: Jul 2007
Posts: 89
raj is on a distinguished road
Post 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";
Reply With Quote