欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  后端开发

PHP 双引号与单引号的区别_PHP教程

程序员文章站 2022-04-08 11:46:17
...
单引号内部的变量不会执行,双引号会执行。


$name = hello;
echo "the $name";
会输出 the hello

而如果是单引号
$name = hello;
echo the $name;
会输出 the $name

主要区别就是这个。

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/486094.htmlTechArticle单引号内部的变量不会执行,双引号会执行。 如 $name = hello; echo "the $name"; 会输出 the hello 而如果是单引号 $name = hello; echo the $name; 会输出...