The role of php comments

angryTom
Release: 2023-04-07 10:18:01
Original
3613 people have browsed it

The role of php comments

The main function of comments in PHP is:

(1) Explain the code function.

(2) Debugging program
Single-line comment //Here is the content of the single-line comment
Multi-line comment/*Multi-line comment*/
Shell-style single-line comments#Comment content

Recommended tutorial:PHP video tutorial

## Several common comment methods in php:

1. Comments in the file header, introducing the file name, function, author version number and other information

/** 
*文件名简单介绍
* 
*文件功能。 
* @author      alvin 作者
* @version     1.0 版本号
*/
Copy after login

2. Function Comments, function functions, parameter introduction and return type

/**  
* 函数的含义说明 
* 
* @access public 
* @param mixed $arg1 参数一的说明 
* @param mixed $arg2 参数二的说明 
* @param mixed $mixed 这是一个混合类型 
* @return array 返回类型
*/
Copy after login

3. Class comments, class name and introduction

/** 
* 类的介绍 
* 
* 类的详细介绍(可选。)。 
* @author      alvin 作者 
* @version     1.0 版本号
*/
Copy after login

The above is the detailed content of The role of php comments. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
php
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!