Home > Backend Development > PHP Tutorial > PHP annotation method

PHP annotation method

angryTom
Release: 2023-04-07 09:56:01
Original
8691 people have browsed it

PHP annotation method

Comments are the basis for every programmer's learning. We can comment on information by commenting. Increase code readability. Below we will introduce you to the annotation method in PHP.

Recommended tutorial: PHP video tutorial

##1, // This is a single line comment

2, # This is also a single-line comment

##3, /* */Multi-line comment block

/*
    这是多行注释块
        它横跨了        
        多行
*/
Copy after login

PHP comment specifications1. Comments on the file header, introducing the file name, function, author version number and other information

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

2. Comments on the function, Function function, 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 PHP annotation method. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
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