Re: PHP 4.0 Bug #4875: array_merge() is unable to merge arrays with numeric keys

From: Date: Wed, 07 Jun 2000 21:00:31 +0000
Subject: Re: PHP 4.0 Bug #4875: array_merge() is unable to merge arrays with numeric keys
References: 1 2 3 4  Groups: php.dev 
Request: Send a blank email to php-dev+get-20512@lists.php.net to get a copy of this message
On Wed, 07 Jun 2000, waldschrott wrote: > 2) Array_Merge() > It would help if array_merge() remembers numeric indices. > $array=array(0=>'foo',5=>'boo',9=>'zoo'); > $array2=array(4=>'loo',7=>'noo'); > $res_array=array_merge($array,$array2); > should result in > > $res_array(0=>'foo',5=>'boo',9=>'zoo',4=>'loo',7=>'noo'); You can use $array1 + $array2 for this. -Andrei * Power corrupts. Atomic power corrupts atomically. *

« previous php.dev (#20512) next »