Adding short comments to your code is recommended and usually a requirement in larger software houses. In PHP, you have three options for commenting style:
/* */, and
#. The first option (two slashes) instructs PHP to ignore everything until the end of the line. The second (a slash and an asterisk) instructs PHP to ignore everything until it reaches
*/. The last (a hash symbol) works like
// and is included because it is common among shell scripting languages.
This code example demonstrates the difference between
<?php echo "This is printed!"; // echo "This is not printed"; echo "This is printed!"; /* echo "This is not printed"; echo "This is not printed either"; */?>
It is generally preferred to use
// because ...