note 10243 deleted from function.array-merge by sniper

From: Date: Mon, 06 Oct 2003 22:56:23 +0000
Subject: note 10243 deleted from function.array-merge by sniper
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-57927@lists.php.net to get a copy of this message
Note Submitter: joerg@krause.net ---- As rlynch@ignitionstate.com states, array_merge kills all integer keys and generates new ones. I've found, that this only happens with values less than 2^31-1 (signed integer). If you use keys greater than 2^32 php recognizes this a strings and leave the keys unchanged. I've you want to preserve the keys, it is recommended to add a string prefix and remove it after merging with, for example, array_walk(). Maybe, for someone this is great feature to clean up an numeric organized array. Joerg Krause www.php.comzept.de

« previous php.notes (#57927) next »