双引号内的变量会被解释,而单引号内的变量则原样输出
<?php $foo = "foobar"; $bar = "barbaz"; echo $foo,$bar; // 输出"foobarbarbaz" echo "<br />"; echo $foo[3]; // 输出第4个字符"b" echo "<br />"; echo "foo is $foo"; // 输出"foo is foobar" echo "<br />"; echo 'foo is $foo'; // 输出"foo is $foo" ?>