What is the difference between ' and "?
The single quotes will print everything inside them literally, including variables, e.g. $var will print as $var, whereas with double quotes the contents will be interpolated.
Here we make the difference clear with a natty example:
<?php
$trings = "No strings attached";
echo '$trings'; //$trings
echo "$trings"; //No strings attached
?>
Comment on this Question and Answer >>>
ASK A QUESTION
More strings PHP Questions
How do I print the " in an echo statement?How do I make the contents of a string upper case?
How do I calculate the metaphone of a string?
How do I break email address into username and hostname?
How do I make the first letter of each word upper case?
