Home  >  Article  >  Backend Development  >  What are the comments in php

What are the comments in php

(*-*)浩
(*-*)浩Original
2019-10-09 10:09:473429browse

Comments in PHP

What are the 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!

Statement:
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