PHP Comments
In this chapter you will learn:
Description
In programming a comment is the description for our code.
Syntax
There are three ways to create comments in PHP:
- //
- /* */, and
- #.
Note
//
and #
mean "Ignore the rest of this line,"
<?php// j a v a 2 s .c o m
print "This is printed\n";
// print "This is not printed\n";
# print "This is not printed\n";
print "This is printed\n";
?>
The code above generates the following result.
/*
means "Ignore everything until you see */
."
<?php/* ja v a 2 s . co m*/
print "This is printed\n";
/* print "This is not printed\n";
print "This is not printed\n"; */
?>
The code above generates the following result.
Next chapter...
What you will learn in the next chapter:
- What is an if statement
- Syntax for if statement
- Note for if statement
- Example - if statement
- Example - if statement with more conditions