PHP supports single - line comments and multi - line comments. To write a single - line comment, start the line with either two slashes (//) or a hash symbol (#). For example:
// This code displays the current timeTo write multi - line comments, start the comment with a slash followed by an asterisk (/*) and end the comment with an asterisk followed by a slash (*/), as follows:
# This code displays the current time
/*So you might comment the PHP code in the hello_with_time.php script like this:
This code displays the
current time in a nice,
easy-to-read format.
*/
< ?php
// Get the current time in a readable format
$currentTime = date( “g:i:s a” );
// Display greeting and time to the visitor
echo “Hello, world! The current time is $currentTime”;
? >