+ 2

Exactly what is the difference between Single Quotation (') and Double Quotation (") in PHP?

29th Dec 2016, 11:35 PM
Saeed Mashhadi
Saeed Mashhadi - avatar
3 Respostas
+ 7
Single on are faster, but they are plain text. Doubles ones search for variables inside , so it takes a bit longer. $World = 3; echo " Hello $World" //output Hello 3 echo 'Hello $World' //output Hello $World
29th Dec 2016, 11:45 PM
Nahuel
Nahuel - avatar
+ 2
use html code in single quotation better than double quotation.
1st Jan 2017, 7:07 PM
rahmat jafari
rahmat jafari - avatar
0
Double quotes force PHP to evaluate the string while single is treated as a string literal. So, using single quotes is faster than using double quotes.
10th Jan 2017, 8:47 PM
Jose Luis
Jose Luis - avatar