note 93768 modified in function.array-merge by danbrown
| From: | danbrown@php.net | Date: | Sun, 27 Sep 2009 21:58:45 +0000 |
| Subject: | note 93768 modified in function.array-merge by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-161114@lists.php.net to get a copy of this message | ||
array_merge will merge numeric keys in array iteration order, not in increasing numeric order. For
example:
<?php
$a = array(0=>10, 1=>20); // same as array(10, 20);
$b = array(0=>30, 2=>50, 1=>40);
?>
array_merge($a, $b) will be array(10, 20, 30, 50, 40) and not array(10, 20, 30, 40, 50).
--was--
array_merge will merge numeric keys in array iteration order, not in increasing numeric order. For
example:
$a = array(0=>10, 1=>20); // same as array(10, 20);
$b = array(0=>30, 2=>50, 1=>40);
array_merge($a, $b) will be array(10, 20, 30, 50, 40) and not array(10, 20, 30, 40, 50).
http://php.net/manual/en/function.array-merge.php