RE: [PHP] associative array syntax question

From: Date: Thu, 04 Oct 2001 00:21:20 +0000
Subject: RE: [PHP] associative array syntax question
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-69848@lists.php.net to get a copy of this message
here is sample output from my script: win98/Apache 1.3.19/php4.0.5 variable being displayed = value $row[TICKER] = NTAP $test = NTAP $quotes[$test] = 8.30 $quotes[{$row[TICKER]}] = will not parse $quotes[$row[TICKER]] = will not parse any ideas? --- "Maxim Maletsky (PHPBeginner.com)" <php-general@phpbeginner.com> wrote: > Strange, I always though it should be working. > > Have you tried $a[{$b['b']}] ? > > What version of PHP are you running? > > Maxim Maletsky > www.PHPBeginner.com > > > > -----Original Message----- > From: Job Miller [mailto:jobmiller@yahoo.com] > Sent: giovedi 4 ottobre 2001 1.41 > To: php-general@lists.php.net > Subject: [PHP] associative array syntax question > > > why does: print $a[$b['b']] return: > > parse error, expecting T_STRING' or T_VARIABLE' or > `T_NUM_STRING' > > but if I do it in two steps like: > > $c=$b['b']; > print $a[$c]; > > it works fine. > > I have tried dozens of syntax combinations using > quotes, no quotes, on one or both and can't get > anything to work. any help would be greatly > appreciated. The two step method is annoying. > > Job > > > __________________________________________________ > Do You Yahoo!? > NEW from Yahoo! GeoCities - quick and easy web site > hosting, just > $8.95/month. http://geocities.yahoo.com/ps/info1 > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: > php-general-unsubscribe@lists.php.net > For additional commands, e-mail: > php-general-help@lists.php.net To > contact the list administrators, e-mail: > php-list-admin@lists.php.net > > __________________________________________________ Do You Yahoo!? NEW from Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month. http://geocities.yahoo.com/ps/info1

« previous php.general (#69848) next »