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, 1814🔥, 0💬
Popular Posts:
How to read RSS validation errors at w3.org? If your RSS feed has errors, the RSS validator at w3.or...
How to use the Atom Online Validator at w3.org? w3.org feed validation service is provided at http:/...
How to use the "send-request" Policy statement to call an extra web service for an Azure API service...
How to create a new API on the Publisher Dashboard of an Azure API Management Service? If you are ne...
How to reinstall npm with a node version manager? I am getting permission errors with the current ve...