I can't seem to figure out how to use array_splice to replace an element
while retaining the key... instead it replaces the key with 0
for example...
$foo=array("color"=>"blue","fruit"=>"apple","foo"=>"bar");
array_splace($foo,1,1,array("car"=>"pinto"));
yields...
Array
(
[color] => blue
[0] => pinto
[foo] => bar
)
instead of
Array
(
[color] => blue
[car] => pinto
[foo] => bar
)
...
Is there a quick and dirty way to do this? or does it require chopping
the array up into to parts and merging them back together again.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php