4 ms·
PHP is terrible, but the following now is valid PHP: $addOne = function($a){ return $a + 1 }; $result = array_map($addOne, array(1,2,3)); // now [2,3,4] O
by damncabbage 14y ago
PHP is terrible, but the following now is valid PHP:
$addOne = function($a){ return $a + 1 };
$result = array_map($addOne, array(1,2,3)); // now [2,3,4]
Or:
// Reference to intval() function.
$result = array_map(intval, array('1','2','a'));