Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- Accessing superglobal elements
November 22, 2007, 8:32 pm
rate this thread
I see that I can access a superglobal element using the index this
print("<p>$_GET[surname]</p>"); //(element index without any
delimiters within a double-quotation-mark-delimited string)
But not this way:
print("<p>$_GET['surname']</p>"); //(apostroph-delimited element index
within a double-quotation-mark-delimited string)
The latter gives me an error message:
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE,
expecting T_STRING or T_VARIABLE or T_NUM_STRING
Why is that? (I cant understand why PHP gets confused by that)
Is this configurable?
Re: Accessing superglobal elements
Actually, the first should give you a notice, also. But you evidently
have notices disabled.
And no, you can't configure it. Just use curly braces, i.e.
Remove the "x" from my email address
JDS Computer Training Corp.
- » ssh on command line: force using a group size (prime size) of 1024 (and no...
- — The site's Newest Thread. Posted in » Secure Shell Forum