Home > Article > Backend Development > 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!