note 112715 added to function.array-map

From: Date: Tue, 16 Jul 2013 10:27:32 +0000
Subject: note 112715 added to function.array-map
Groups: php.notes 
Request: Send a blank email to php-notes+get-195640@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/112715 Del: integrated -- https://master.php.net/note/delete/112715/integrated Del: useless -- https://master.php.net/note/delete/112715/useless Del: bad code -- https://master.php.net/note/delete/112715/bad+code Del: spam -- https://master.php.net/note/delete/112715/spam Del: non-english -- https://master.php.net/note/delete/112715/non-english Del: in docs -- https://master.php.net/note/delete/112715/in+docs Del: other reasons-- https://master.php.net/note/delete/112715 Reject -- https://master.php.net/note/reject/112715 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#195640) next »