Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

PHP Build a Simple PHP Application Adding a Contact Form Redirecting After a Form Submission

Why use double quotes

Hi again ! I've noticed that all the teachers generally use double quotes instead of single ones. I don't know why, double quotes are just an extra keypress :)

1 Answer

it's part left-over habit and part out of ease of use. Older languages used to use double-quotes for strings and single quotes for characters. So you were always using double quotes.

Also if you're using contractions you'll want that apostrophe and it's a pain to have to remember to escape it in the middle of a string so a lot of people just default to double quotes.

For more detailed reference here's the PHP Manual entry on Strings.

Thanks !