Categories:
.NET (357)
C (330)
C++ (183)
CSS (84)
DBA (2)
General (7)
HTML (4)
Java (574)
JavaScript (106)
JSP (66)
Oracle (114)
Perl (46)
Perl (1)
PHP (1)
PL/SQL (1)
RSS (51)
Software QA (13)
SQL Server (1)
Windows (1)
XHTML (173)
Other Resources:
How To Return a Value Back to the Function Caller
How To Return a Value Back to the Function Caller? - PHP Script Tips - Creating Your Own Functions
✍: 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
2007-04-24, 4960👍, 0💬
Popular Posts:
How To Merge Cells in a Column? - XHTML 1.0 Tutorials - Understanding Tables and Table Cells If you ...
How To Set session.gc_maxlifetime Properly? - PHP Script Tips - Understanding and Using Sessions As ...
If locking is not implemented what issues can occur? IFollowing are the problems that occur if you d...
What are secure and non-secure websites? A secure Website uses the Secure Socket Layer (SSL) protoco...
How do I force the Dispose method to be called automatically, as clients can forget to call Dispose ...