Writing Comments

Writing the executed PHP code itself is only a part of the programming process. A secondary but still crucial aspect to dynamic Web site development involves documenting your code.

In HTML you can add comments using

<!-- Comment goes here. -->

HTML comments are viewable in the source (Figure 1.11) but do not appear in the rendered page.

Figure 1.11. HTML comments appear in the source code but not in the Web page itself.

PHP comments are different in that they aren’t sent to the Web browser at all, meaning they won’t be viewable to the end user, even when looking at the HTML source.

PHP supports three comment types. The first ...

Get PHP and MySQL for Dynamic Web Sites: Visual Quickpro Guide, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.