note 17682 added to function.array-splice
| From: | stf at c-gix dot com | Date: | Wed, 19 Dec 2001 13:49:32 +0000 |
| Subject: | note 17682 added to function.array-splice | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-23333@lists.php.net to get a copy of this message | ||
array_splice always drops keys from the replacement.
Example :
$tmp = array( "a" => "toto" , "b" => "titi" ,
"c" => "tutu" );
array_splice($tmp, 1, 1, array("d" => "tata" ));
print_r($tmp);
will result in :
Array ( [a] => toto [0] => tata [c] => tutu )
where one would expect :
Array ( [a] => toto [d] => tata [c] => tutu )
--
http://www.php.net/manual/en/function.array-splice.php
http://master.php.net/manage/user-notes.php?action=edit+17682
http://master.php.net/manage/user-notes.php?action=delete+17682
http://master.php.net/manage/user-notes.php?action=reject+17682