|
|
Tutorials » Php »
|
Topic |
What is Return statement?
|
|
Explanation |
|
Return statement is used to end the execution of a function, eval() function or a script file. If called from a global scope it ends the execution of the script file.
Syntax:
return (Value);
Return statement can return values or else the value returned is null
Example:
<?php
function test1()
{
return;
}
print gettype(test1()) . "\n";
?>
Result:
NULL
In the above example the value returned by "Return" statement is NULL
|
|
A Note |
Learn PHP programming language tutorial with simple and neat example. Hope you enjoy this free tutorial.
Do give us your valuable feedback and suggestions on this online tutorial. This is a Copyright Content.
|
|
|
|