Blogger Information
Blog 22
fans 0
comment 2
visits 10433
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
php的变量定义以及字符串的变量分析及应用--2018年8月21日
Jerry-wang的博客
Original
593 people have browsed it

一:

实例

<?php

$name1 = '网友1';
$name2 = '网友2';

$echo1 = $name2.':'. '\''.$name1.',兄弟们好好赢一场让我放松下,明天就高考了\'';
$echo2 = "{$name1}:\"!!!???\"";


echo $echo1, '<br>', $echo2;
echo '<br>';
echo $itse = <<<HEREDOC
{$name2}:"高考不是今天吗?";
HEREDOC;

echo '<br>';

echo $its = <<< "HEREDOC"
{$name1}:"....XXX已退出游戏"; 
HEREDOC;

echo '<br>';

echo <<<NOWDOC
$name2 :“20吧”
NOWDOC;

echo '<br>';

运行实例 »

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

二:手抄代码

微信图片_20180823145815.jpg

笔记:

heredoc相当于双引号,可以解析内部的变量以及特殊的转义字符;

nowdoc相当于单引号


Correction status:qualified

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