[thelist] PHP - need clarification of quotes in array names.

Kristy Frey kristenannfrey at yahoo.com
Wed Feb 6 17:29:01 CST 2002


--- Afonso Fernandez Nogueira <afonso at writeme.com> wrote:
> > How then do I echo $foo['bar'] as part of a string? if I have:
> > $foo['bar'] = "hello";
> > echo "$foo['bar'] world";
> > This gives an error.
> > If I have
> > $foo['bar'] = "hello";
> > echo "$foo[bar] world";
> > This works, but is it wrong?

Perhaps try:
$foo['bar'] = "hello";
echo $foo['bar']." world";


=====
----------------------------------------------------------
I apologize for the ads/links below - Yahoo put them there.
That's what I get for using free mail
----------------------------------------------------------

__________________________________________________
Do You Yahoo!?
Send FREE Valentine eCards with Yahoo! Greetings!
http://greetings.yahoo.com



More information about the thelist mailing list