PHP Comments – How to Apply Comments in PHP
[Full Tutorial]
In this tutorial, we will discuss, How to apply Comments in PHP. In computer programming, a comment is a programmer-readable explanation. They are added with the purpose of making the source code easier for humans to understand, and are generally ignored by compilers and interpreters.
Author Writer: Arshad Sultan [ Expert ]
Author Uploaded: Arshad Sultan
Learn How to Integrate Laravel with Firestore
There are two ways to apply PHP comments:
Single-line comments:
Start with //
and continue until the end of the line and also use #
sign for single line comments.
[php]<?php
// This is a PHP single line comments.
// Second line Comments.
# This is also a single-line PHP comment.
echo “Tutorials Ocean is online Free Computer Education WebSite”;
?>[/php]
Multi-lines comments:
Start with /*
and end with */
. Multi line comments are used for large text descriptions of code
[php]<?php
/*
This is a PHP multi line comments.
PHP Comments
*/
echo “Tutorials Ocean provide Free online quality Computer Education”;
?>[/php]