1.单引号内的$name这样的变量不会被解析,双引号的则会。(即:单引号里的字符串是什么就输出什么)
<?php $name = 'zhangsan'; $str = 'He is $name'; echo $str; ?>
输出:He is $name如果换成双引号,则输出:He is zhangsan