本文概述
PHP注释可用于描述任何代码行, 以便其他开发人员可以轻松理解代码。它也可以用来隐藏任何代码。
PHP支持单行和多行注释。这些注释类似于C / C ++和Perl样式(Unix shell样式)的注释。
PHP单行注释
在PHP中有两种使用单行注释的方法。
- //(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";
?>
输出
欢迎使用PHP单行注释
PHP多行注释
在PHP中, 我们也可以注释多行。为此, 我们需要将所有行括在/ * * /中。让我们看一个简单的PHP多行注释示例。
<?php
/*
Anything placed
within comment
will not be displayed
on the browser;
*/
echo "Welcome to PHP multi line comment";
?>
输出
欢迎使用PHP多行注释
来源:
https://www.srcmini02.com/29155.html
微信公众号
手机浏览(小程序)
Warning: get_headers(): SSL operation failed with code 1. OpenSSL Error messages:
error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed in
/mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line
57
Warning: get_headers(): Failed to enable crypto in
/mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line
57
Warning: get_headers(https://static.shanhubei.com/qrcode/qrcode_viewid_38058.jpg): failed to open stream: operation failed in
/mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line
57