Magento Engineer
social
Journal

array_map function

The array_map() function sends each value of an array to a user-made function, and returns an array with new values, given by the user-made function.

Example:

function myfunction($num) {

return($num*$num);

}

$a=array(1,2,3,4,5);

print_r(array_map("myfunction",$a));

Ad comes here
Comments
  • raj
    7 years ago

    very helpfull

Leave A Comment
PHP blog
Update Cookies Preferences