What is the correct way to concatenate strings in PHP for output?

When concatenating strings in PHP for output, you can use the dot (.) operator to combine multiple strings together. This allows you to build a single string that includes the content of multiple variables or literal strings. Make sure to include the dot operator between each string element to concatenate them properly.

// Concatenating strings in PHP
$string1 = "Hello";
$string2 = "World";
$output = $string1 . " " . $string2;
echo $output;