Main Content

A comment on comments in PHP

Archive - Originally posted on "The Horse's Mouth" - 2013-04-28 09:55:16 - Graham Ellis

It's vital when you write a program that you comment it well. That's so that your colleagues will understand later on what you have done (and why you have done it), and so that YOU can remember too. And it's because commenting is vital that every course we teach, from the very first program after "Hello World", includes comments!

There's a PHP example [here] ... there are no fewer that three ways of commenting in PHP, or four if you include comments within the generated HTML too.