码迷,mamicode.com
首页 > Web开发 > 详细

PHP中对变量使用单引号和双引号的区别

时间:2017-05-16 15:47:24      阅读:180      评论:0      收藏:0      [点我收藏+]

标签:区别   text   pre   引号   hello   ext   name   单引号   echo   

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


$name = ‘hello‘;
echo "the $name";

会输出 the hello

而如果是单引号

$name = ‘hello‘;
echo ‘the $name‘;

会输出 the $name

主要区别就是这个了。

PHP中对变量使用单引号和双引号的区别

标签:区别   text   pre   引号   hello   ext   name   单引号   echo   

原文地址:http://www.cnblogs.com/yeyeyemax/p/6861601.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!