As with most programming languages (or maybe all programming languages), PHP supports comments.

PHP follows the traditional C style comments but it also adds a couple of non-C style ones too. There are a total of three different ways a comment can be opened in PHP:

• #
• //
• /* */
PHP
<?php
# Put our code here
// Put our code here

/*
* This comment is
* multiline
*/
?>


The # and // comments are interchangeable whereas the /* and */ combination is the multiline comment.

Code preview
Feedback 👍
Comments are sent via email to me.