How to add comments in php code or html code, ignore single line or multiple lines

Adding comments to PHP code or HTML code for understanding the code is quite easy, this method will also help to ignore single line of code or multiple line of codes while testing your code.

Adding comments to HTML CODE

To add comments to HTML CODE use below syntax –

<!– Add your comments here –>

Adding comments to PHP CODE

  1. To add comments to single line “//” or “#”

for e.g.

PHP CODE – 

<?php
echo “What is my name”; // This will display the sentence
// echo “I am scholar”;
# echo “I sleep on time”;
?>

OUTPUT WILL BE –

What is my name

2. To add comments to multiple line of code in php follow below method –

PHP CODE – 

<?php

/* echo “What is my name”;
echo “I am scholar”;
echo “I sleep on time”; */

echo “I want to learn more”;
?>

OUTPUT WILL BE –

I want to learn more

I hope above explanation will help you.

Read More
GoTitNow.in March 20, 2016 0 Comments
Call Back Request
close slider

    Contact Form
  • Please Tick to Submit"I authorize GoTitNow.in representative to contact me through Email, SMS, Calls. I understand that this will override the DND status on my mobile number and I have no objection for the same."