RE: Parse error: parse error, expecting `']'' in

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



To view the terms under which this email is distributed, please go to http://disclaimer.leedsmet.ac.uk/email.htm



On 02 December 2004 13:22, Robert Sossomon wrote:

> But what I don't understand is why sometimes
> '$_POST[variable]' works and why
> sometimes it will only work when it is '$_POST['variable']' .
> 
> Even through my reading and examples I see it both ways, so anyone
> able to give me a direction to go with it?  I am thinking of just
> changing my coding to put it the second way, but...???

It's valid to put unquoted array subscripts inside a double-quoted string;
it's not valid anywhere else.  Look at the comment at the start of the
second example at
http://uk.php.net/manual/en/language.types.string.php#language.types.string.
parsing.simple for the official position on this.

Cheers!

Mike

---------------------------------------------------------------------
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Headingley Campus, LEEDS,  LS6 3QS,  United Kingdom
Email: m.ford@xxxxxxxxxxxxxx
Tel: +44 113 283 2600 extn 4730      Fax:  +44 113 283 3211 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux