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, 4799👍, 0💬
Popular Posts:
The following variable is available in file1.c, who can access it? static int average; Answer: all t...
Can Java object be locked down for exclusive use by a given thread? Yes. You can lock an object by p...
Can you have virtual functions in Java? Yes, all functions in Java are virtual by default. This is a...
Regarding C Coding Given: Line in file Contents 30 int * someIDs, theFirst, *r; 110 someIDs =GetSome...
What are database triggers? How are the triggers fired? Read this collection of questions and answer...