What is the correct way to return a value from a PHP function?

When returning a value from a PHP function, you should use the `return` keyword followed by the value you want to return. It is important to ensure that the return statement is the last statement in the function, as no code after the return statement will be executed. Additionally, make sure to assign the returned value to a variable when calling the function to use the returned value.

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

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