Jump to content

[SOLVED] To quote or not to quote


JaneDean

Recommended Posts

Hi,

I am very new to PHP (and probably at a disadvantage to many other PHP coders, because it's the first coding/programming language I've learnt), and I'm having some trouble with when to use quotes in PHP. I am learning from a book, and sometimes I am told to call variables using single quotes, eg. $_POST['name'], and sometimes using none at all, eg. $_POST[name]. I have found that whether or not I use quotes actually does make a difference, and using them unnecessarily can break the script, as well as vice versa. I was wondering if anyone could explain this to me?

Sorry if this is a stupid question. I've been wondering since I started the book, and I still haven't worked it out.

Thanks in advance,
JaneDean
Link to comment
Share on other sites

Aah, thanks for your help. I think I am using an old book; I've had a few problems like this with it. But I am genetically required to use anything I have paid good money for ;).

Also, thanks for the link to the manual. It looks like a much faster way to clean up any problems with the book.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.