Re: Wicked, Array add problem!

From: Date: Mon, 22 Oct 2001 23:07:22 +0000
Subject: Re: Wicked, Array add problem!
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-71880@lists.php.net to get a copy of this message
I was wondering if someone could help me with the following problem I want to add values to an array, overwriting the existing ones and keeping the original intact. array 1 looks like: text posted = Posted by source = Bron array 1 looks like: text posted = Posted by1 Now i would like to have the following result: text posted = Posted by1 source = Bron Like an OVerlay array 2 over array 1 function or something.. Please can someone help me? Warm regards, Emile Bosch <? echo "<pre>"; $array1 = array("text"=>array("posted"=>"Posted by","source"=>"Bron")); $array2 = array("text"=>array("posted"=>"Posted by1")); print_r($array1); print_r($array2); print_r(array_merge($array1,$array2)); /* I was hoping that this below would turn out but that is not the issue what function must i use to get this result?? Array ( [text] => Array ( [posted] => Posted by1 [source] => Bron ) ) */ echo "</pre>"; ?> "Emile Bosch" <emilebosch@hotmail.com> schreef in bericht news:20011022222536.55020.qmail@pb1.pair.com... > I was wondering if someone could help me with the following problem > I want to add values to an array, overwriting the existing ones and keeping > the original intact. > > array 1 looks like: > text > posted = Posted by > source = Bron > > array 1 looks like: > text > posted = Posted by1 > > Now i would like to have the following result: > > text > posted = Posted by1 > source = Bron > > Like an OVerlay array 2 over array 1 function or something.. > > Please can someone help me? > Warm regards, > > Emile Bosch > > > <? > echo "<pre>"; > $array1 = array("text"=>array("posted"=>"Posted > by","source"=>"Bron")); > $array2 = array("text"=>array("posted"=>"Posted by1")); > > print_r($array1); > print_r($array2); > > print_r(array_merge($array1,$array2)); > > /* > I was hoping that this below would turn out but that is not the issue > what function must i use to get this result?? > Array > ( > [text] => Array > ( > [posted] => Posted by1 > [source] => Bron > ) > > ) > */ > echo "</pre>"; > ?> > >

« previous php.general (#71880) next »