Tools, FAQ, Tutorials:
Returning a Value from a Function in PHP
How To Return a Value Back to the Function Caller? in PHP?
✍: FYIcenter.com
You can return a value to the function caller by using the "return $value" statement. Execution control will be transferred to the caller immediately after the return statement. If there are other statements in the function after the return statement, they will not be executed. Here is a PHP script example on how to return values:
<?php
function getYear() {
$year = date("Y");
return $year;
}
print("This year is: ".getYear()."\n");
?>
This script will print:
This year is: 2006
⇒ Passing an Argument to a Function in PHP
⇐ Invoking a User Function in PHP
2016-12-24, ∼2805🔥, 0💬
Popular Posts:
How to use the "set-body" Policy Statement for an Azure API service operation? The "set-body" Policy...
How to validate the id_token signature received from Azure AD v2.0 authentication response? You can ...
Where to find tutorials on Python programming language? I want to learn Python. Here is a large coll...
How to use the JSON to XML Conversion Tool at utilities-online.info? If you want to try the JSON to ...
How to use the "set-variable" Policy Statement to create custom variables for an Azure API service o...