Skip to main content
PHP Output Prediction Easy +10 XP

Variable Concatenation

What does this output?

PHPRead-only
$name = "World";
echo "Hello, " . $name . "!";

What is the output?

Show answer and explanation

Answer: Hello, World!

PHP uses the dot (.) operator for string concatenation. $name is substituted with its value.

Hint: PHP uses . for concatenation.

What this challenge tests

Output Prediction in PHP: strings, concatenation.

Related challenges