Usage of Quotes
In PHP, single and double quotes are used to enclose strings. Following code would throw a PHP error since the string hasn’t been enclosed by quotes.
$name = Robin Jackman;
It has to be enclosed by quotes like below.
$name = 'Robin Jackman';
While both single and double quotes can be used to enclose strings, there is a difference in how PHP interprets two methods. If you used double quotes then PHP would interpret variables and special characters (\t, \n etc) inside the string but if you used single quotes PHP would consider only the literal value of the whole string.
$name = 'Robin Jackman'; echo "Name is $name"; // Would print Name is Robin Jackman echo 'Name is $name'; // Would print Name is $name
Usually single quotes are used when the whole statement is a simple string (like ‘Name is Robin Jackman’) and double quotes are used when the statement contains variables to be interpreted (like “Name is $name”).