Home > php教程 > php手册 > body text

PHP注释实例技巧

WBOY
Release: 2016-06-13 12:26:56
Original
913 people have browsed it

复制代码 代码如下:


$a = 1;
$b = 2;
if (1==1) {
$andy = '帅哥';
}
?>


一般注释的时候,用

复制代码 代码如下:


/*
$a = 1;
$b = 2;
*/
if (1==1) {
$andy = '帅哥';
}
?>


调程序的时候,老要把后面的*/拿到前面去,很麻烦

复制代码 代码如下:


/**/
$a = 1;
$b = 2;
if (1==1) {
$andy = '帅哥';
}
?>


现在应该这样写
这样是注释掉

复制代码 代码如下:


/**
$a = 1;
$b = 2;
if (1==1) {
$andy = '帅哥';
}
/**/

?>
这样是不注释

复制代码 代码如下:


/**/
$a = 1;
$b = 2;
if (1==1) {
$andy = '帅哥';
}
/**/
?>


再附上一个小规范
所有php文件,末尾都不要
?>
这样可以避免有空白输出
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template