What is the purpose of the "return" statement in PHP functions?

The "return" statement in PHP functions is used to explicitly specify the value that the function should output or return when it is called. This allows functions to perform a computation or task and then pass the result back to the code that called the function. Without a return statement, a function may execute its code but not provide any output or result to the calling code.

function addNumbers($num1, $num2) {
    $sum = $num1 + $num2;
    return $sum;
}

$result = addNumbers(5, 3);
echo $result; // Output: 8