Contact: aviboots(AT)netvision.net.il
39,851 questions
51,772 answers
573 users
function square($number) { return $number * $number; } $array = [1, 2, 3, 4, 5, 6]; $array = array_map('square', $array); echo "<pre>"; print_r($array); echo "</pre>"; /* run: Array ( [0] => 1 [1] => 4 [2] => 9 [3] => 16 [4] => 25 [5] => 36 ) */