Is there big difference between single quotes and double quotes while we are using echo in php? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Is there big difference between single quotes and double quotes while we are using echo in php?

echo "$a"; echo '$a'; echo $a; echo ($a);

6th Dec 2017, 3:40 PM
Rahul Jain
Rahul Jain - avatar
1 Answer
+ 7
the first scenario echo("$a"); checks if there is a variable called $a....if not it outputs "$a" as string and if there is a variable outputs the variables value the second echo('$a'); states that output $a as string regardless of whether there is a variable $a! the third echo($a); searches for a variable $a and outputs it value the fourth performs the same crap as the third
6th Dec 2017, 4:35 PM
᠌᠌Brains[Abidemi]
᠌᠌Brains[Abidemi] - avatar