PHP Comment  (//), and ( /*, */).

PHP Tutorial Comment  (//), and ( /*, */).

Comment is a programming comand us to hide a section of code in a program. The command are used in many way, when a programmer suspect a bug in some section of a program  he is writing, then he can use comment to hide that section of program untill he was able to find out where the error is coming from.

Just as the name inply, comment comand are often used sometimes by programer to leave a comment or explanation in a program for some reasons, like either the program will be maintain by another programmer, or there is something he want to revert back too later on in that section of the program as he procced.

There are two way of using a comment in programming ;

  1. Comment to hide a single line of code, (//).

These comment use double backslash (//)

When a programmer know that bug is coming from single line of code, these comment is use to hide that line. For example

<?php

<P>Omokoshaban.com is a website that deal with rendring website design and tutorial</P>

<P>Omokoshaban.com also deal with teaching chemistry, medical lab, and physic .,,,,</P>

?>

Now let assume that there is bug in our second line of our code, and we want to hide it, so what we need to do to hide the code now is just to add double backslash on the begning of the code.

 when we run the code now that particular line we add comment will not be recornize.

Example shown below;

<?php

<P>Omokoshaban.com is a website that deal with rendring website design and tutorial</P>

See also  Agony of a Father: Flying Officer Tolulope Arotile’s Family

//<P>Omokoshaban.com also deal with teaching chemistry, medical lab, and physic .,,,,</P>

?>

Now you know how to use doudble backslash (//) on your program let proceed to single backslash and exteric ( /*, */).

  1. Comment to hide mutiple line of code ( /*, */).

These comment use single backslash with exteric (/*) as the open tag and exteric and single backslah(*/) as the closing tags.

These comment is used to hide mutiple line of code. These coment is what programmer use often to leave a comment in there program.

The comment goes a folow;

<?php

<P>Omokoshaban.com is a website that deal with rendring website design and tutorial</P>

<P>Omokoshaban.com also deal with teaching chemistry, medical lab, and physics, also we believe that when you continue coming to our website, you will learn a lot, please make sure you visit our website everyday .,,,,</P>

?>

Now on the above code we whant asign comment  after first line of code above to the last line of our code, see example below;

<?php

<P>Omokoshaban.com is a website that deal with rendring website design and tutorial</P>

/*<P>Omokoshaban.com also deal with teaching chemistry, medical lab, and physics, also we believe that when you continue coming to our website, you will learn a lot, please make sure you visit our website everyday .,,,,</P>*/

?>

Now if we run our code, from second line of the code to the  last line which place our comment on will not display.

Thanks for reading,

Hope these tutorial Is helpful? don’t forget if you have any question on suggetion, please leave it on our comment section below.

Be the first to comment

Leave a Reply

Your email address will not be published.


*