How can you output text in a different location within an if statement in PHP?

When you want to output text in a different location within an if statement in PHP, you can use the concatenation operator (.) to combine strings and variables together. By breaking up the text into separate parts and concatenating them as needed, you can control where the output appears within the if statement.

$condition = true;

if ($condition) {
    $output = "This text is ";
    $output .= "output in a different location ";
    $output .= "within the if statement.";
    
    echo $output;
}