Putting Comments in PHP Programs

The PHP programming language supports three styles of writing comments. They should look familiar if you have worked in C, C++, C#, Java, JavaScript, or Linux/Unix shell scripting. The following types of commenting are supported in PHP:

  • The single-line C++, C#, Java, or JavaScript comment syntax

  • The multiple-line C++, C#, Java, or JavaScript comment syntax

  • The Linux or Unix shell comment syntax

The next sections will demonstrate the various commenting syntaxes supported by the PHP programming language.

Single-Line PHP C++, C#, or Java-Style Comments

You may use a single-line comment to begin a line or to append a comment to a line. Single-line comments may be two forward slashes with no intervening white space. ...

Get Oracle Database 10g Express Edition PHP Web Programming 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.