Skip to content

PHP echo

Syntax

The echo statement in PHP is used to output text or multiple values and does not return a value.

// Using echo to output a single string
echo "Hello, World!";
// Using echo with multiple parameters
echo "Hello", " ", "World!";
// Using echo with parentheses (optional)
echo("Hello World!");
// Using echo with variable
echo $variableName;