代码改变世界

PHP单引号和双引号的区别

2011-05-28 14:06  卫佳  阅读(192)  评论(0编辑  收藏  举报

单引号内部的变量不会执行

  双引号会执行

如$name = 'hello';

echo "the $name";

// cufflinks wholesale

  会输出 the hello

  而如果是单引号

  $name = 'hello';

  echo 'the $name';

  会输出 the $name

  主要区别就是这个。