How can PHP variables be properly concatenated within echo statements for HTML output?

When concatenating PHP variables within echo statements for HTML output, you can use the period (.) operator to join the variables and strings together. This allows you to seamlessly integrate PHP variables into your HTML output without breaking the echo statement.

$name = "John";
$age = 25;

echo "Hello, " . $name . "! You are " . $age . " years old.";