|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2001-08-06 12:51 UTC] andrei@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 13:00:02 2025 UTC |
if any of the keys of the first level of arrays are numeric, using array_merge_recursive() will renumber them to start at 0. this destroys keys that are used to record id numbers, etc. [mini:pgl]:~/public_html $ cat test.php #!/usr/local/bin/php -q <? $b[a][4] = 1; $a[3][4] = 2; print_r(array_merge_recursive($a, $b)); ?> [mini:pgl]:~/public_html $ ./test.php Array ( [0] => Array ( [4] => 2 ) [a] => Array ( [4] => 1 ) )