Skip to content

PHP Comments

Syntax

Comments in PHP can be written as single-line or multi-line comments.

// This is a single-line comment
echo "Hello, world!"; // Comment at end of line
// Comment out code
// echo "Hello, world!";
// Multiple
// single-line
// comments
# This is another single-line comment
/*
This is a
multi-line comment
*/