There are three types of comments in php, namely: 1. Single-line comment [//]; 2. Single-line comment [#]; 3. Multi-line comment [/**&*/]. Comments in PHP will not be read and executed as a program, their function is to be read by code editors.
The operating environment of this article: windows10 system, php&7, thinkpad&t480 computer.
Any programming language has its own programming annotation method. Comments are very useful, not only for debugging the program, but also for describing the function of the code.
There are three kinds of comments in php:
1, &//& This is a single line comment
2, #& This is also a single line comment
3,/*&*/Multi-line comment block
/*
This is a multi-line comment block
It spans
multiple lines
*/
PHP& Comments in the code will not be read and executed as a program. Its only purpose is to be read by code editors.
Recommended learning: php training
The above is the detailed content of There are several types of comments in php. For more information, please follow other related articles on the PHP Chinese website!