Re: Array - partical path to the array's path....

From: Date: Tue, 27 Sep 2005 19:55:19 +0000
Subject: Re: Array - partical path to the array's path....
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-223306@lists.php.net to get a copy of this message
Wow, that seem to work... Should have use "$suffix" instead of "$prefix" to make it less confusing. "Silvio Porcellana" <sporc@tin.it> wrote in message news:43398984.9020505@tin.it... > Scott Fletcher wrote: > > >What I want this to work instead is > >[code] > > $array = array(); > > > > $array['col1']['col2'] = "Test #1"; > > $array['col3']['col2'] = "Test #2"; > > > > $prefix = "['col3']['col2']"; > > > > echo $array.$prefix; //Spitted out result as "Test #2"... > >[/code] > > > > > Try something like this: > <code> > $var = "\$array".$prefix; > eval("echo $var;"); > </code> > > HTH, cheers > Silvio

« previous php.general (#223306) next »