[thelist] Re: thelist digest, Vol 1 #1986 - 30 msgs

NanHarbisonSmith at aol.com NanHarbisonSmith at aol.com
Tue Feb 5 22:11:01 CST 2002


--
[ Picked text/plain from multipart/alternative ]
There is a really excellent book out there for beginners, it is called "PHP
for the World Wide Web", by Larry Ullman, published by Peachpit Press, it is
one of a series called the Visual Quickstart Guides. It clearly shows you how
to do this stuff.
Nan

In a message dated 2/5/2002 12:04:47 PM Eastern Standard Time,
thelist-request at lists.evolt.org writes:


> Hi, I'm quite new to PHP, and having a bit of trouble with Arrays,
>
> The manual says $foo[bar] is wrong, and appears to say I should use
> $foo['bar']. OK
> 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?
> Or should I write
>     $foo['bar'] = "hello";
>     echo $foo['bar']." world";
> which is a bit more work.
>
> Is $foo[0] the correct way to access the first value in the array $foo? or
> does that need quotes too!
>
> Please help a very confused newbie,
> Cheers, Donald
>
> PS. Any links to pages on how to write clean efficient coding are much
> appreciated.
>


Nan Harbison Smith
www.colonial.net

"If the shoe fits, get another one just like it."- George Carlin





More information about the thelist mailing list