php语法参考-基本语法指令分隔符和注释
2013-10-31 12:47
369 查看
指令分割方式与C或者perl类似---每个语句有分号隔开。
结束标记(?>)同样隐含语句的结束,因此下面的代码是等价的
<?php
echo "This is a text";
?>
<?php echo "This is a test"?>
注释:
php支持'c',c++和unix shell风格的注释;例如:
<?php
echo "This is a test";//This is a one-line c++ style comment
/*This is a multi line comment
yet another line of comment*/
echo "This is yet another test";
echo "One Final Test";#This is shell-style style comment
?>
"单行"注释仅仅注释到行末或者当前的代码块,视乎哪个首先出现。
<h1>This is an <?php # echo "simple"?>example.</h1>
<p>The header above will say 'This is an example'.
小心不要嵌套'C'风格的注释,当注释大量的代码时,可能犯该错误。
<?php
/*
echo "This is a test";/*This comment will cause a problem*/
*/
?>
单行注释仅仅注释到行末或者当前的php代码块
结束标记(?>)同样隐含语句的结束,因此下面的代码是等价的
<?php
echo "This is a text";
?>
<?php echo "This is a test"?>
注释:
php支持'c',c++和unix shell风格的注释;例如:
<?php
echo "This is a test";//This is a one-line c++ style comment
/*This is a multi line comment
yet another line of comment*/
echo "This is yet another test";
echo "One Final Test";#This is shell-style style comment
?>
"单行"注释仅仅注释到行末或者当前的代码块,视乎哪个首先出现。
<h1>This is an <?php # echo "simple"?>example.</h1>
<p>The header above will say 'This is an example'.
小心不要嵌套'C'风格的注释,当注释大量的代码时,可能犯该错误。
<?php
/*
echo "This is a test";/*This comment will cause a problem*/
*/
?>
单行注释仅仅注释到行末或者当前的php代码块
相关文章推荐
- php语法参考-基本语法指令分隔符和注释
- PHP手册-语言参考-基本语法-指令分隔符
- PHP手册-语言参考-基本语法-注释
- PHP的基本语法——PHP语言标记及指令分隔符“分号”
- php 语言参考-基本语法-从html中分离
- PHP手册-语言参考-基本语法-从HTML中分离
- PHP手册-语言参考-基本语法-PHP标记
- 复习:JSP基本语法(JSP注释 + JSP指令 + JSP脚本元素 + JSP动作元素)
- PHP学习笔记(一):基本语法之标记、空白、和注释
- 复习PHP-语言参考-基本语法
- PHP-Manual的学习----【语言参考】----【基本语法】
- java基础--1.基本语法 - 1.关键字、标志符和注释
- php页面的基本语法
- php explode() 函数的基本语法及使用实例
- JavaWeb从0开始学(二)-----JSP基本语法与编译指令
- 初学PHP的基本脉络(仅供初学PHP的同学参考)(一)
- 初学PHP的基本脉络(仅供初学PHP的同学参考)(四)
- PHP第一季视频教程.李炎恢.学习笔记(三)(第2章 基本语法(2))
- 初学PHP的基本脉络(仅供初学PHP的同学参考)(五)
- C、Delphi和PHP的基本语法对照表