Not only a good answer, but the best explanation.

thanks,

bill hollett

Rasmus Lerdorf wrote:

> > The first echo statement doesn't work, the second does.  Anybody know
> > why?
> >
> > $string1=15;
> > $string2=27;
> > $myarray[$string1][$string2]="syncopated";
> > echo "$myarray[$string1][$string2]<br />\n";   //displays Array[27]
> > echo $myarray[$string1][$string2] . "<br />\n";  //displays syncopated
>
> Complex variables inside quoted strings need to be dereferenced using {}'s
>
> eg.
>
> echo "{$myarray[$string1][$string2]}<br />\n";
>
> Or better yet:
>
> echo $myarray[$string1][$string2] . "<br />\n";
>
> -Rasmus


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to