时间:2021-07-01 10:21:17 帮助过:3人阅读
如果一个变量放在单引号中,会被当作字符串来处理,如果是放在双引号中,则会被当值一个变量来处理(此时可以用 {}扩起来,也可以不用)。
1 php2 $txt = "hello, this is from txt";3 echo 'the word is {$txt}'; //the word is {$txt}4 echo "the word is {$txt}"; //the word is hello, this is from txt