note 85000 added to function.array-combine
| From: | J dot D dot D dot at osu1 dot php dot net | Date: | Sat, 09 Aug 2008 20:31:29 +0000 |
| Subject: | note 85000 added to function.array-combine | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-143335@lists.php.net to get a copy of this message | ||
This may be obvious, but I don't see anything about it on the manual page, so a friendly
warning... The array you are using as keys must have all unique values. If not, array elements get
dropped.
$arr_notUnique = array('one' , 'one' , 'two');
$arr_b = array('red' , 'green' , 'blue');
$arr_combo = array_combine($arr_notUnique, $arr_b);
Results: Array ( [one] => green [two] => blue )
NOT: Array ( [one] => red [one] => green [two] => blue )
----
Server IP: 69.147.83.197
Probable Submitter: 74.176.63.119
----
Manual Page -- http://www.php.net/manual/en/function.array-combine.php
Edit -- https://master.php.net/note/edit/85000
Del: integrated -- https://master.php.net/note/delete/85000/integrated
Del: useless -- https://master.php.net/note/delete/85000/useless
Del: bad code -- https://master.php.net/note/delete/85000/bad+code
Del: spam -- https://master.php.net/note/delete/85000/spam
Del: non-english -- https://master.php.net/note/delete/85000/non-english
Del: in docs -- https://master.php.net/note/delete/85000/in+docs
Del: other reasons-- https://master.php.net/note/delete/85000
Reject -- https://master.php.net/note/reject/85000
Search -- https://master.php.net/manage/user-notes.php