What are the comments in php

(*-*)浩
Release: 2023-02-25 21:10:02
Original
3450 people have browsed it

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>
Copy after login

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!

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