PHP 注釋
PHP注釋可用于描述代碼的任何一行,以便其他開發(fā)人員能夠輕松理解代碼。愛掏網(wǎng) - it200.com它還可以用于隱藏任何代碼。愛掏網(wǎng) - it200.com
PHP支持單行和多行注釋。愛掏網(wǎng) - it200.com這些注釋類似于C/C++和Perl樣式(Unix shell樣式)的注釋。愛掏網(wǎng) - it200.com
在PHP中有兩種使用單行注釋的方式。愛掏網(wǎng) - it200.com
//
(C++樣式單行注釋)#
(Unix shell樣式單行注釋)
<?php
// this is C++ style single line comment
# this is Unix Shell style single line comment
echo "Welcome to PHP single line comments";
?>
輸出:
Welcome to PHP single line comments
PHP多行注釋
在PHP中,我們也可以注釋多行。愛掏網(wǎng) - it200.com要這樣做,我們需要將所有的行括在 /* */ 之間。愛掏網(wǎng) - it200.com讓我們看一個(gè)PHP多行注釋的簡單示例。愛掏網(wǎng) - it200.com
<?php
/*
Anything placed
within comment
will not be displayed
on the browser;
*/
echo "Welcome to PHP multi line comment";
?>
輸出:
Welcome to PHP multi line comment
聲明:所有內(nèi)容來自互聯(lián)網(wǎng)搜索結(jié)果,不保證100%準(zhǔn)確性,僅供參考。如若本站內(nèi)容侵犯了原著者的合法權(quán)益,可聯(lián)系我們進(jìn)行處理。