Correction status:qualified
Teacher's comments:
代码
<?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;
点击 "运行实例" 按钮查看在线实例
手写