Home  >  Article  >  Backend Development  >  What does php use to comment single lines of code?

What does php use to comment single lines of code?

藏色散人
藏色散人Original
2019-09-16 13:52:514166browse

What does php use to comment single lines of code?

What does php use to comment a single line of code?

All text around "//" in a line will be Treated as comments, the PHP parser will ignore the code to the right of the line "//" as follows:

<?php
echo "test"; // 这是单行注释
?>

If the first line only writes comments and no code, the content after "//" will also be ignored. will be displayed. The code is as follows:

<?php
//这是单行注释
echo “test”;
//这是单行注释
?>

Related recommendations: "PHP Tutorial"

The above is the detailed content of What does php use to comment single lines of code?. 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