如果一个变量放在单引号中,会被当作字符串来处理,如果是放在双引号中,则会被当值一个变量来处理(此时可以用 {}扩起来,也可以不用)。
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
已抢187095个
抢已抢67502个
抢已抢353773个
抢已抢668460个
抢已抢123872个
抢已抢26062个
抢