Home > Article > Backend Development > What are the comments in php
Comments in PHP
Comments in PHP code will not be read and executed as a program. Its only purpose is to be read by code editors.
Comments are used for: (Recommended learning: PHP video tutorial)
Let others understand the work you are doing - comments can let others Programmers understand what you did at each step (if you work on a team)
Remind yourself of what you did - Most programmers have experienced reworking a project after a year or two and then having to Reconsider what they have done. Comments can record your thoughts while writing code.
PHP supports three types of comments:
Example
<!DOCTYPE html> <html> <body> <?php // 这是单行注释 # 这也是单行注释 /* 这是多行注释块 它横跨了 多行 */ ?> </body> </html>
The above is the detailed content of What are the comments in php. For more information, please follow other related articles on the PHP Chinese website!