quotes.php

Double quotes

I like runescape.

Single quotes

I like $item.

Explanation

In PHP, double quotes can read variables inside the string, so $item becomes the value automatically. Single quotes do not do that though so PHP prints the text exactly as I write it. Double quotes are good for both text and variables; single quotes are good when you want plain text only.

Back