If you don't add any quotation marks after echo, you can also display text information. Why do you need to add single quotation marks? Is there any difference?
搜扑互联2020-02-02 17:41:40
0
4
1586
If you don’t add any quotation marks after echo, text information can also be displayed. Why do you need to add single quotation marks? Is there any difference?
Single quotes support escaping but do not support output variables. According to the code format specifications, not adding quotes is not recognized. It will appear to others that you are not rigorous enough.
replyDouble quotes support escaping, variable output, and HTML tag output, for example:
$str = "<h1>If I have to add a time in front of ***, I would like to do it immediately. </h1>";
echo $str;
Single quotes support escaping but do not support output variables. According to the code format specifications, not adding quotes is not recognized. It will appear to others that you are not rigorous enough.
Single quotes: plain text. Double quotes: supports escaping such as \\ and outputs \. {$a} outputs the contents of variable $a=xxx.
If there happens to be a string that is a constant, it is another matter