Are there alternative methods to using "echo" for output in PHP functions?

Using "echo" for output in PHP functions is a common practice, but there are alternative methods such as returning values using the "return" keyword. This allows the function to output data without directly echoing it. By returning values, you can store or manipulate the output before displaying it to the user.

function outputMessage() {
    $message = "Hello, World!";
    return $message;
}

// Call the function and output the result
echo outputMessage();