We all use plenty of ‘ {single quote} and ” {double quote} in our PHP code. As a beginner a lot of us use them without knowing the difference and use it according to our personal choice. The confusion starts to build up when we start using variables. And a lot of time is lost in debugging what is going wrong.
In short the difference between them is –
Single Quote – It shows the output as entered in the script
Double Quote – It parses variables and special characters written within
To make things clear with an example
$ask = 'Question';
echo 'Ask the $ask'; /// prints - Ask the $ask
echo "Ask the $ask"; /// prints - Ask the Question