JavaScript Error

You currently have JavaScript disabled on your web browser.

This website uses JavaScript, and This web page needs JavaScript activated to work correctly.

Please active JavaScript on your web browser and then refresh this web page.



Comments



In PHP the comment is a line or section of code or text that is not executed as part of the program, and is simply ignored.

Comments are your friend. Use them as often and as much as you like.

The main purpose and benefits for having and using comments are:

Examples

PHP supports several ways of commenting:

 

	// This is a single-line comment
	
# This is also a single-line comment
/* This is a multi-line comment */

Single-Line Comments

Single line comments start with //.

Any text or code between // and the end of the line will be ignored (will not be executed).

Although not commonly used as often, the hashtag symbol # can also be used for single line comments, and it behaves the same as //.

 

	// Outputs a hello message:
	echo "Hello World!";
	
	echo "This is Fun!"; // Yes it is fun
	
	// The following code is commented out:
	//echo "Let's go already!";
	

Multi-Line Comments

Any text or code between /* and */, no matter if it is on a single line, multiple lines, or within code, will be ignored (will not be executed):

 

	
	/* The famous "Hello World!".
	   This example uses PHP's echo command to display it.
	   Feel free to copy this example and use it however you like.
	   Modified By : Tim Tolbert
	   Last Modified: July 15, 2025
	*/
	echo "Hello World!";
	


Final Thoughts

Thank you for reading, I hope you found this blog post (tutorial) educational and helpful.


(0) pollYesResult
(0) pollNoResult



 
     About   |   Contact Us   |   Privacy   |   Terms & Conditions   |   © 2025 - T&J Divisions, LLC, All Rights Reserved