Blogger Information
Blog 16
fans 0
comment 1
visits 19047
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
php基础知识第一课--创建变量规则驼峰法--0821
学先森的博客
Original
953 people have browsed it

代码

实例

<?php
/**
 * file:lesson08.php
 */
echo "php 中文网";
$siteName = "php 中文网";
$siteAdd = "www.php.cn";
echo "<br>";
//单引号引起的字符串不能识别变量原样输出
echo '{$siteName}网址是 {$siteAdd}<br><h1 style="color:red">n</h1>';
//双引号引起的字符串能识别变量并且把变量值一起输出
echo "<br>{$siteName}网址是{$siteAdd}";
//转义并输出特殊字符
echo "<br>";
echo '单引号\' 双引号" \n  \r \t  ';
echo "<br> 单引号' 双引号\" \n  \r \t  ";
//heredoc相当于双引号引起的字符串
echo <<<"heredoc"
<br>
{$siteName}
网址是
$siteAdd
<br>
heredoc;
//nowdoc相当于单引号引起的字符串
echo <<<'nowdoc'
<hr>
<h1 style="color:green">n</h1>
<br>  \n \r \t
{$siteName}
网址是
$siteAdd
<br>
nowdoc;

运行实例 »

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

手写1535337039264.jpg

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