$addOne = function($a){ return $a + 1 }; $result = array_map($addOne, array(1,2,3)); // now [2,3,4]
// Reference to intval() function. $result = array_map(intval, array('1','2','a'));