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, 1242👍, 0💬
Popular Posts:
Where to find tutorials on API Management Services at Azure Portal? Here is a list of tutorials to a...
How to use the API operation 2017 version setting "Rewrite URL template"? The API operation setting ...
dev.FYIcenter.com is a Website for software developer looking for software development technologies,...
How to include additional claims in Azure AD v2.0 id_tokens? If you want to include additional claim...
Where to find tutorials on the 2017 version of API Management Services at Azure Portal? Here is a li...