Blogger Information
Blog 38
fans 0
comment 0
visits 30700
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
web服务器访问原理配置本地虚拟主机php变量命名规则变量解析字符转义总结——2018年8月22日11:53:20
图图的博客
Original
476 people have browsed it

QQ截图20180822114025.png

实例

<?php
// 定义变量
$a = 100;
$name = wy;
echo '期末开始考了{$a}分','<br>'; //单引号不解析变量,将变量名按普通字符串输出
echo $b = "期末开始考了{$a}分",'<br>';        //双引号解析变量
echo "\\",'<br>';//用\转义输出一个反斜线
echo "\"",'<br>';//用\转义输出一个双引号
echo "$b";
echo "<hr>";
echo <<< "HEREDOC"//HEREDOC相当于双引号
$name
HEREDOC;
echo "<br>";
echo <<<'NOWDOC'//NOWDOC相当于单引号
$name 
NOWDOC;
?>

运行实例 »

点击 "运行实例" 按钮查看在线实例

Correction status:qualified

Teacher's comments:作业中有错误哦!heredoc和<<<中间是不能有空格的啊!
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments