> I had some code that was working nicely.  In it, I was assigning values to
> a
> multidimensional array like:
> 
> $array_name[0] = array(
>     key1 => 'val',
>     key2 => 'val',
>     key3 => 'val');
> 
> I added a function that directly assigns vars to the same array like:
> 
> $array_name[0][key4] = 'val';
> 
> If this function is called prior to the multiple assignment code, it
> erases
> the directly assigned key/value pair [key4] = 'val'.

try :

$array_name[0][key4] = 'val4';
$array_name[0]=array_merge(
  array(
    key1 => 'val1',
    key2 => 'val2',
    key3 => 'val3'
  ),
  $array_name[0]);

this will work ...
michi

-- 
GMX - Die Kommunikationsplattform im Internet.
http://www.gmx.net


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to