note 112716 added to function.array-map

From: Date: Tue, 16 Jul 2013 10:34:55 +0000
Subject: note 112716 added to function.array-map
Groups: php.notes 
Request: Send a blank email to php-notes+get-195641@lists.php.net to get a copy of this message
array_map becomes interesting and faster than foreach when used with existing PHP functions. Example: $arr1 = array(1, 2, 3, 4); $arr2 = array(4, 3, 2, 1); // array with min values for each key print_r(array_map("min", $arr1, $arr2)); Result: Array ( [0] => 1 [1] => 2 [2] => 2 [3] => 1 ) // array with max values for each key print_r(array_map("max", $arr1, $arr2)); Result: Array ( [0] => 4 [1] => 3 [2] => 3 [3] => 4 ) ---- Server IP: 69.147.83.199 Probable Submitter: 197.1.158.146 ---- Manual Page -- http://php.net/manual/en/function.array-map.php Edit -- https://master.php.net/note/edit/112716 Del: integrated -- https://master.php.net/note/delete/112716/integrated Del: useless -- https://master.php.net/note/delete/112716/useless Del: bad code -- https://master.php.net/note/delete/112716/bad+code Del: spam -- https://master.php.net/note/delete/112716/spam Del: non-english -- https://master.php.net/note/delete/112716/non-english Del: in docs -- https://master.php.net/note/delete/112716/in+docs Del: other reasons-- https://master.php.net/note/delete/112716 Reject -- https://master.php.net/note/reject/112716 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#195641) next »