Heim  >  Artikel  >  Backend-Entwicklung  >  PHP注释实例技巧_PHP教程

PHP注释实例技巧_PHP教程

WBOY
WBOYOriginal
2016-07-21 15:49:45891Durchsuche

复制代码 代码如下:

$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文件,末尾都不要
?>
这样可以避免有空白输出

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/319470.htmlTechArticle复制代码 代码如下: ?php $a = 1; $b = 2; if (1==1) { $andy = '帅哥'; } ? 一般注释的时候,用 复制代码 代码如下: ?php /* $a = 1; $b = 2; */ if (1==1) { $andy...
Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn