Discussion: array_merge bug ?
Afficher un message
Vieux 07/08/2007, 18h20   #3
Rik
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: array_merge bug ?

On Tue, 07 Aug 2007 19:12:15 +0200, cornelius <cornelius@nospam.org> wrote:

> I've just found the solution :
>
> $Result = $Table1 + $Table2 ;
>
> is better than :
>
> $Result = array_merge($Table1, $Table2) ;


Depends on wether you want to preserve the key :P

For future reference/people finding this thread: array_merge reindexes
numerical array's, and on a merge will _overwrite_ string keys but
_append_ numerical keys.
--
Rik Wasmus
  Réponse avec citation
 
Page generated in 0,05933 seconds with 9 queries