$name = 'hello';
echo "the $name";
会输出 the hello
而如果是单引号
$name = 'hello';
echo 'the $name';
会输出 the $name
双引号中的变量会被其值替换;单引号会原样输出。
主要区别就是这个,其他的无所谓
$name = 'hello';
echo "the $name";
会输出 the hello
而如果是单引号
$name = 'hello';
echo 'the $name';
会输出 the $name
双引号中的变量会被其值替换;单引号会原样输出。
主要区别就是这个,其他的无所谓