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 reverse a string in PHP?How do I convert characters to HTML entities using PHP?
How do I find the position of a letter in a string in PHP?
How do I replace a word in a string in PHP?
How do I convert newlines to HTML line break tags?
