PHP 注釋
PHP注釋可用于描述代碼的任何一行,以便其他開發人員能夠輕松理解代碼。愛掏網 - it200.com它還可以用于隱藏任何代碼。愛掏網 - it200.com
PHP支持單行和多行注釋。愛掏網 - it200.com這些注釋類似于C/C++和Perl樣式(Unix shell樣式)的注釋。愛掏網 - it200.com
在PHP中有兩種使用單行注釋的方式。愛掏網 - 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中,我們也可以注釋多行。愛掏網 - it200.com要這樣做,我們需要將所有的行括在 /* */ 之間。愛掏網 - it200.com讓我們看一個PHP多行注釋的簡單示例。愛掏網 - 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
聲明:所有內容來自互聯網搜索結果,不保證100%準確性,僅供參考。如若本站內容侵犯了原著者的合法權益,可聯系我們進行處理。