Re: trying to quote keys in arrays causes error, Why
| From: | Jason Wong | Date: | Thu, 07 Feb 2002 20:09:29 +0000 |
| Subject: | Re: trying to quote keys in arrays causes error, Why | ||
| References: | 1 2 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-16626@lists.php.net to get a copy of this message | ||
On Friday 08 February 2002 03:30, Peter J. Schoenster wrote:
> Hi,
>
> Someone pointed out that I should quote "key" in arrays.
What someone forgot to point out was that within double-quoted strings you
should not quote the keys.
> If I do this:
>
> <input type="hidden"
> location="$input["keynameherewithquotes"]">
>
> or just this:
> $input[REQUEST_URI]
> in a heredoc
>
> I get the following
>
> > Parse error: parse error, expecting
T_STRING' or
> > T_VARIABLE' or
> > `T_NUM_STRING' in
> > /usr/local/etc/httpd/htdocs/readbrazil.com/htdocs/login.php on line 49
>
> but this works fine:
>
> <input type="hidden" location="$input[keynameherewithquotes]">
As you have discovered yourself :)
--
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
/*
It is far better to be deceived than to be undeceived by those we love.
*/