![]() |
![]() |
![]() | |
![]() International Sites:
|
Comments in PHP (Advanced version or higher)In HTML you have got the possibility to include comments into the source code. Of course you could do this in the templates as well.
In HTML you have got the possibility to include comments into the source code. Of course you could do this in the templates as well. However PHP as well provides the possibility to include comments within the PHP sections. The advantage hereby is that the PHP interpreter removes these comments so that they are not transmitted. This gives the advantage, separate from the shorter transmission, that your comments are invisible for users. A further application of comments in PHP is to commentate commands off. Commands within comment lines can be quasi deactivated in this way, but yet they are not deleted and can be reactivated at any time. There are two possibilities in PHP to commence comments. One is to use "//". A comment is commenced by two slashes and extends to the end of the line. That means that everything behind the two slashes is ignored, but only in the current line. The second possibility allows to commentate off a whole section. Such a comment is commenced by "/*" and stopped by "*/". Everything in-between is ignored. Such a comment can also extend over several lines. An example for this: Please attend to the last PHP command ("echo(date..."): This command is not executed, since it is commentated off by the two slashes. We recommend to use comments frequently and elaborately. We are going to use such comments as well in our following examples in order to make them clearer and more transparent. Please note that the pre-processor of the Light version does not support comments. PHP paragraphs with comments are ignored in the Light version. Therefore comments can only be used from the Advanced version on (and in higher versions) in which complete PHP is provided. [Back] - [Bookmark] - [Optimized for Printing] - [Send by E-mail] - [Contact] Copyright © 2000-2002 by Portunity GmbH (Germany) - All rights reserved. |
![]() ![]()
Direct links to the new Portalsuite 2002: |