Home > Article > Backend Development > PHP provides several code comment styles, what are they?
php provides 3 code comment styles, which are: 1. C-style single-line comments, the syntax is "//comment content"; 2. C-style multi-line comments, the syntax is "/* comment content" */"; 3. UNIX-style single-line comments, the syntax is "# comment content".
The operating environment of this tutorial: Windows 7 system, PHP version 7.1, DELL G3 computer
Comments in the PHP code will not be treated as programs to read and execute. Its function:
Code explanation
Description of script related information
Convenient for debugging, Test
php provides 3 code comment styles:
①Single line comment (C style), symbol: //
<?php echo "单行注释" ;//一般在代码右边少量说明或写在代码前面使之失效 ?>
②Multi-line comments (C style), symbols: /* */
<?php echo "多行注释" ; echo "多行注释" ; /* 一般说明脚本的相关信息,如版本,版权,作者日期等 使一长段代码失效 */ ?>
③Special single-line comments (not commonly used, UNIX style), Symbol:
<?php echo "单行注释" ;#一般在代码右边少量说明或写在代码前面使之失效 ?>
Recommended study: "PHP Video Tutorial"
The above is the detailed content of PHP provides several code comment styles, what are they?. For more information, please follow other related articles on the PHP Chinese website!