PHP Questions Home | Register | Login
Categories
Arrays
Files
Forms
Creating PDFs
PHP Errors
Functions
Images
MySQL
Numbers
Others
Strings
Website
Unanswered

PHP Forums
Forums Index
MySQL Forum
PHP Forum
Flash/Actionscript
Javascript
Web design

More PHP
PHP Functions
Top Questions
Ask a Question
PHP Interview Questions
PHP Jobs
Ecommerce
IT Questions
Business Websites

Sponsors

sponsor ad
My Salary
PHP Developer Salary
Advertise Here

How do I add comments to my PHP script?


If you want to add comments, there are various options for you.

For single line comments, the most common method is the double slash, like this:
<?php
//this is a comment
?>


For multi-line comments you can either use the above method, but it's easier to do this:
/*
This is a comment that spans several lines
This brilliant code was written by me
Use comments throughout your scripts so you can remember what on earth they do when you come back to it six months later
Or if another programmer has to support your code, then give them a chance by filling it with copious comments, it's good practice
*/
?>



Comment on this Question and Answer >>>

ASK A QUESTION

More other PHP Questions

What are autoglobals?

What does the @ character do in PHP?

Can I spellcheck my text using PHP?

how can i put the value 1 or 0 into checkbox if we checked then 1 otherwise 0?

I have lots of if else logic - is there another option?



Custom Search