PHP中单引号和双引号的区别在于,单引号内部的内容不会被解析,也就是试做纯文本,而双引号内部的内容会被解析为php代码。举个例子
<?php
$nu = 12;
echo 'this is. $nu';
echo "this is. $nu";
?>
这个简短的代码输出为
this is.$nu
this is. 12
由此可以看出两个的区别
PHP中单引号和双引号的区别在于,单引号内部的内容不会被解析,也就是试做纯文本,而双引号内部的内容会被解析为php代码。举个例子
<?php
$nu = 12;
echo 'this is. $nu';
echo "this is. $nu";
?>
这个简短的代码输出为
this is.$nu
this is. 12
由此可以看出两个的区别