Blogger Information
Blog 18
fans 0
comment 0
visits 9946
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
PHP搭建环境与基本语法2018年8月21日作业
吕小布的博客
Original
418 people have browsed it

821.jpg

实例

<?php
$a='大米饭';
$b='今天我吃'.$a.'了,真好吃';//单引号解析变量
$c="今天我吃{$a}了真好吃";//双引号解析变量
$d="今天\"肯德基\"真好吃";//转意符
echo '<hr>',$c,'<hr>',$b,'<hr>',$d;
//heredoc 双引号定义字符串
$heredoc=<<<DDD
<ul>
    <li>你好</li>
    <li>php</li>
    <li>中文网</li>
</ul>
DDD;

echo $heredoc;
//单引号定界符
$nowdoc=<<<NNN
<ul>
    <li>你好</li>
    <li>我是</li>
    <li>单引号</li>
</ul>
NNN;
echo $nowdoc;

运行实例 »

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

Correction status:qualified

Teacher's comments:注意:nowdoc是必须得加单引号的!heredoc可以不用加引号,nowdoc不可以!
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
Author's latest blog post