What is the comments in PHP?
In this episode you will learn :
- What is the Comments on PHP
- How many Comments on PHP?
- What is Single Line Comments in PHP? How is Single Line Commented write in PHP?
- What is the Multi Line Comments on PHP? How to make a Multi Line comment in PHP?
What is PHP Comments?
What is PHP comments, a question we asked our community party who attended our warehouse rental Los Angels hackathon party last year. Their answers? Well, you can find those answers below.
PHP Comments: Comments in PHP or any Programming Language are the explanations or footnotes of a code or programmer’s source code. We can call it Coding Documentation. Generally, any Programming Language Compiler and Interpreter avoid comments (Ignore) without executing the code as a code. With Comments System, we will not be used right now in addition to Coding Documentation, but we can also hide the codes that we can use in the future.
How Many Comments on PHP?
Comments in PHP are basically two types:
1. Single Line Comments (Each line has to use a comment mark separately)
2. Multi Line Comments (For multiple lines comment, use the mark only once.)
What is the Single Line Comments in PHP? How is Single Line Commented use in PHP?
A programmer in PHP uses the comment mark on each line separately, it is called Single Line Comments. It is also call short comments. Single Line comment on PHP use # (hash) and // (two slashes). Let’s better understand the following example:
<?php echo 5+4; // Here's a single-line PHP comments for 5 and 4 summation echo "Hello World"; # Here's another single-line PHP comments for "Hello World" String ?>
Explanation: Notice that the two lines here that we have enclosed on single line comment, these two lines will not come in our browser.
What is the Multi Line Comments on PHP? How to make a Multi Line comment in PHP?
A programmer in PHP uses only one comment mark for multiple lines. In the terminology of PHP, it is called Multi Line Comments. Multi Line Comments with / * * / in PHP Let’s better understand the following example:
<?php /* Here's a long PHP comments spread over many lines. You can format a multi-line comment any way you like. */ echo "Hello World"; ?>
Explanation: Notice that all the lines we have here are basically tied to the line comment, they will not come in our browser.
Hi, My name is Masud Alam, love to work with Open Source Technologies, living in Dhaka, Bangladesh. I’m a Certified Engineer on ZEND PHP 5.3, I served my first Fifteen years a number of leadership positions at AmarBebsha Ltd as a CTO, Winux Soft Ltd, SSL Wireless Ltd, Canadian International Development Agency (CIDA), World Vision, Care Bangladesh, Helen Keller, US AID and MAX Group where I worked on ERP software and web development., but now I’m a founder and CEO of TechBeeo Software Company Ltd. I’m also a Course Instructor of ZCPE PHP 7 Certification and professional web development course at w3programmers Training Institute – a leading Training Institute in the country.