Blogger Information
Blog 14
fans 0
comment 0
visits 7854
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
web服务器访问原理+命名规则+字符串变量解析--2018年8月22号10点
Taoing的博客
Original
765 people have browsed it

实例

<?php
//字符串

$money = '95亿美元';
//$title1 = '阿里'.$money.'收购了饿了么';
$title1 = '阿里$money收购了\'饿了么\'';
$title2 = "阿里{$money}收购了\\\"饿了么\"";

echo $title1, '<br>', $title2, '<br>';
echo nl2br($title2);

echo '<hr>';

//heredoc
// heredoc 等价使用了双引号的字符中,可以解析内部的变量和转义特殊字符
echo  <<< "HEREDOC"
{$title2} \n  \r \t 
HEREDOC;

// nowdoc
// 相当于用单引号包装的字符串
echo <<< 'NOWDOC'
{$title2} \n  \r \t
<h3><a href="">Hello 同学们晚上好呀</a></h3>
NOWDOC;

运行实例 »

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

]T9PAS6DYTW72%DDP{)MMHX.png

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