php comment block code example

Example 1: php comment

// This is a single-line comment

# This is also a single-line comment

/*
This is a multiple-lines comment block
that spans over multiple
lines
*/

Example 2: comment in php

<?php
 /*
    echo 'This is a test'; /* This comment will cause a problem */
 */
?>

Example 3: php comment

<?php
// This is a single-line comment

# This is also a single-line comment
  
/*
This is a multiple-lines comment block
that spans over multiple
lines
*/
  
// You can also use comments to leave out parts of a code line
$x = 5 /* + 15 */ + 5;
echo $x;
?>

Example 4: how to make a comment in php

// single line comment
/* multi line comment
hello
*/

Example 5: comment php

// This is a single-line comment
# This is also a single-line comment
/*
This is a multiple-lines comment block
that spans over multiple
lines
*/

Example 6: comment in php

It is worth mentioning that, HTML comments have no meaning in PHP parser. So,

<!-- comment
<?php echo some_function(); ?>
-->

WILL execute some_function() and echo result inside HTML comment.

Tags:

Html Example