[PHP] associative array syntax question

2001-10-03 Thread Job Miller
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

RE: [PHP] associative array syntax question

2001-10-03 Thread Maxim Maletsky \(PHPBeginner.com\)
: [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

RE: [PHP] associative array syntax question

2001-10-03 Thread Job Miller
To: [EMAIL PROTECTED] 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

Re: [PHP] associative array syntax question

2001-10-03 Thread Philip Olson
Hi Job. This works for me (and *should* always work) : $a = array('foo' = 'bar'); $b = array('b' = 'foo'); print $a[$b['b']]; // prints bar How _exactly_ are you calling it? (provide a short standalone ex) Does the above example work for you? What version of php? regards, Philip

RE: [PHP] associative array syntax question

2001-10-03 Thread Maxim Maletsky \(PHPBeginner.com\)
[mailto:[EMAIL PROTECTED]] Sent: giovedi 4 ottobre 2001 2.21 To: [EMAIL PROTECTED] Subject: RE: [PHP] associative array syntax question 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

[PHP] associative array syntax question

2001-10-03 Thread Maxim Maletsky \(PHPBeginner.com\)
-Original Message- From: Maxim Maletsky (PHPBeginner.com) [mailto:[EMAIL PROTECTED]] Sent: giovedi 4 ottobre 2001 2.02 To: 'Job Miller' Subject: RE: [PHP] associative array syntax question I tried on winXP/PHP4.0.6/Apache ? $a = Array('print me'); $b = Array('b'=0

Re: [PHP] associative array syntax question - got it!

2001-10-03 Thread Job Miller
: giovedi 4 ottobre 2001 2.02 To: 'Job Miller' Subject: RE: [PHP] associative array syntax question I tried on winXP/PHP4.0.6/Apache ? $a = Array('print me'); $b = Array('b'=0); print $a[$b['b']] # prints: # print me ? Strange, should work though

RE: [PHP] associative array syntax question - got it!

2001-10-03 Thread Maxim Maletsky \(PHPBeginner.com\)
: giovedi 4 ottobre 2001 2.44 To: Maxim Maletsky (PHPBeginner.com); [EMAIL PROTECTED] Subject: Re: [PHP] associative array syntax question - got it! Maxim, I figured it out. Thanks for your help PHP can't interpolate within string when nested associative array is used. the nested aa must be appended

RE: [PHP] associative array syntax question - got it!

2001-10-03 Thread Matthew Loff
) [mailto:[EMAIL PROTECTED]] Sent: giovedi 4 ottobre 2001 2.02 To: 'Job Miller' Subject: RE: [PHP] associative array syntax question I tried on winXP/PHP4.0.6/Apache ? $a = Array('print me'); $b = Array('b'=0); print $a[$b['b']] # prints: # print me

RE: [PHP] associative array syntax question - got it!

2001-10-03 Thread Maxim Maletsky \(PHPBeginner.com\)
Yes, that does for sure Maxim Maletsky www.PHPBeginner.com -Original Message- From: Matthew Loff [mailto:[EMAIL PROTECTED]] Sent: giovedi 4 ottobre 2001 4.02 To: 'Job Miller'; 'Maxim Maletsky (PHPBeginner.com)'; [EMAIL PROTECTED] Subject: RE: [PHP] associative array syntax question