Add comments or edit out lines in PHP & HTML

If you’re adding lines or editing code in html, tpl or php it is a good idea to leave yourself or others comments.

Of course this method can also be used comment out lines of code for testing purposes.

HTML, TPL commenting is achieved by prefixing the section with <-- and ending it in -->

All of the below example would be commented out / ignored in HTML.

<--
all of this is just 
here to demonstrate that
none of this will actually
appear in the html code!
-->

PHP commenting is achieved by prefixing each line with # for a single line or /* and */ for blocks of text.

All of the below examples would be commented out / ignored in PHP.

# this single line would not appear / be actioned in the php code!
/* all of this is just 
here to demonstrate that
none of this will actually
appear in the php code! */
Print Friendly, PDF & Email

More Like This


Categories


Web Design Web Hosting
  • Post a comment