Re: single vs. double quotes inside a $_POST{}



On Sun, 17 May 2009 22:21:24 -0400, Jerry Stuckle
<jstucklex@xxxxxxxxxxxxx> wrote:

Daniel wrote:
On Sun, 17 May 2009 21:35:40 -0400, Jerry Stuckle
<jstucklex@xxxxxxxxxxxxx> wrote:

Daniel wrote:
On Sat, 16 May 2009 17:20:33 GMT, jdoerr <jdoerr@xxxxxxxxxxx> wrote:

What's preferred (or better)?
$_POST['name']
$_POST["name"]
I understand the difference, re: variables (which explains why
$_POST['$tmp'] doesn't work), and I appreciate the corrections on my
prior use of $_POST[name].

thanks.

I don't believe it makes any difference...

Daniel
It does make a difference. That's why there are two different syntaxes.

it does if you need to embed variables in them. But in cases like the
one above, you rarely need to do so... And since the example was
mentinoed with constants, that's it, they kinda work the same...

Daniel

The key here being 'kinda'. Try embedding a '$' in a double quoted
string, for instance, i.e. "They paid $millions for it."

You're absolutely right; but who would put a html input field with
dollars in it? Cause that was about it - $_POST['name'] vs the one wth
double quotes...

Daniel
.



Relevant Pages

  • Re: single vs. double quotes inside a $_POST{}
    ... and I appreciate the corrections on my ... prior use of $_POST. ... Who said anything about an html input field id? ... nothing wrong with having an array index with a '$' in it. ...
    (comp.lang.php)
  • Re: MS Office Professional Plus 2007 has locked, why?
    ... If you failed to uninstall any trial version, then rebooted, prior to ... installing your paid for version, that is the cause of your problem ... then reboot, prior to installing your paid for version ...
    (microsoft.public.office.misc)
  • Re: Avoid Shirtpocket.co.uk, they are fraudsters
    ... > I wish I'd read this page prior to ordering something early this month. ... > As I paid by debit card, bank tells me they cannot reverse charge or give me ...
    (uk.comp.sys.palmtops)
  • Re: SWAs newest gadget
    ... On Sep 15 2009 4:50 PM, DocTCW wrote: ... hours prior to departure. ... four paid the extra $10 and four just managed to beat me ...
    (alt.vacation.las-vegas)
  • directory size
    ... really paid much attention to prior to now. ... background info. ...
    (alt.os.linux)