RE: [PHP] Arrays: Please help before I go insane?

From: Date: Thu, 06 Jun 2002 20:06:58 +0000
Subject: RE: [PHP] Arrays: Please help before I go insane?
Groups: php.general 
Request: Send a blank email to php-general+get-101015@lists.php.net to get a copy of this message
In that case, split it up into two-steps, to only init the array if you need to.... i'm not really sure how the rest of your code is -- you could probably do this a nicer way, but this will work: if (!is_array($ary["this"])) $ary["this"] = array(); $ary["this"]["that"] = 1; --- Scott Hurring Systems Programmer EAC Corporation ScottH@eac.com Voice: 201-462-2149 Fax: 201-288-1515 > -----Original Message----- > From: Chris Boget [mailto:chris@wild.net] > Sent: Thursday, June 06, 2002 3:43 PM > To: Scott Hurring > Cc: PHP General > Subject: Re: [PHP] Arrays: Please help before I go insane? > > > > Try: $ary["this"] = array("that" => 1); > > That works great until "this" has 2 children. The second child > overwrites the first. :( > > Chris > >

« previous php.general (#101015) next »