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, ∼2955🔥, 0💬
Popular Posts:
How to add an API to an API product for internal testing on the Publisher Portal of an Azure API Man...
How to add request URL Template Parameters to my Azure API operation to make it more user friendly? ...
How to build a test service operation to dump everything from the "context.Request" object in the re...
Where to find tutorials on Python programming language? I want to learn Python. Here is a large coll...
How to troubleshoot the Orderer peer? The Docker container terminated by itself. You can follow this...