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 Reference from a Function
How To Return a Reference from a Function? - PHP Script Tips - Creating Your Own Functions
✍: FYIcenter.com
To return a reference from a function, you need to:
Here is a PHP script on how to return a reference from a function:
<?php
$favor = "vbulletin";
function &getFavorRef() {
global $favor;
return $favor;
}
$myFavor = &getFavorRef();
print("Favorite tool: $myFavor\n");
$favor = "phpbb";
print("Favorite tool: $myFavor\n");
?>
This script will print:
Favorite tool: vbulletin Favorite tool: phpbb
As you can see, changing the value in $favor does affect $myFavor, because $myFavor is a reference to $favor.
2007-04-14, 5012👍, 0💬
Popular Posts:
When should the method invokeLater() be used? This method is used to ensure that Swing components ar...
Which bit wise operator is suitable for turning off a particular bit in a number? The bitwise AND op...
Does .NET support UNICODE and how do you know it supports? Yes .NET definitely supports UNICODE. Try...
How can I show HTML examples without them being interpreted as part of my document? Within the HTML ...
If we have multiple AFTER Triggers on table how can we define the sequence of the triggers ? If a ta...