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
https://forums.phpfreaks.com/topic/36039-solved-to-quote-or-not-to-quote/
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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.