To return the flow control to the calling mode, a RETURN statement is used. Buy applying the RETURN statement the execution of the program resumes from where it was left,; that behaviour it’s called a module invocation.

If the RETURN statement is in the function, it returns back to the source program from where it was called along with the argument usually.

Syntax for RETURN statement

<?php
    echo "RETURN statement";
    return;
?>

Example with RETURN statement in a function

 

›› go to examples ››