PHP Return Statement
Syntax
The return statement in PHP is used to exit a function and optionally return a value to the caller.
function functionName() { // Code to execute return $value;}
// Call functionfunctionName();Example
function sayHello() { return 'Hello World';}
echo sayHello();// Output: Hello World