Blogger Information
Blog 40
fans 1
comment 0
visits 31950
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
变量的命名规则,字符串中的变量解析0821
郭稳重啊的博客
Original
874 people have browsed it

0821作业

实例

<?php
 header("Content-type:text/html;charset=utf-8");
//字符串,\"代表一个双引号字符,\'代表一个单引号(撇号)字符
$data='2018年8月22日';
$years = '114周年';
$title1 = '$data是\'邓小平同志\'诞辰$years';
$title2 = "{$data}是\"邓小平同志\"诞辰{$years}";
echo $title1, '<br>', $title2, '<br>';
echo nl2br($title2);
echo '<hr>';
// heredoc 等价使用了双引号的字符中,可以解析内部的变量和转义特殊字符
//\n 的意思是回车换行,\r回车(CR) ,将当前位置移到本行开头\t 的意思是 横向跳到下一制表符位置
echo  <<< "HEREDOC"
{$title2} \n \r \t
HEREDOC;
// 相当于用单引号包装的字符串
echo <<< 'NOWDOC'
{$title2} \n \r \t
<h3><a href="">你好,PHP!</a></h3>
NOWDOC;
?>

运行实例 »

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



YK(RLZ2W85`OJRX23{YM9ES.png

手写作业:

E7C029BC5B58F79CF63ED704B1286241.jpgBACE8AF9788276857C6D9E8405134A7C.jpg


Correction status:Uncorrected

Teacher's comments:
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