Php reference is a very learned thing. The following describes how to return functionamp; fun (); for php reference. I hope the example can help you. the example code is as follows :? Phpnbsp... php reference is a very learned thing. next we will introduce the php reference to return function & fun (); learning notes. I hope the example can help you.
The sample code is as follows:
data; } public function out(){ echo $this->data; } } $aa = new talker(); $d = &$aa->get(); $aa->out(); $d = 'How'; $aa->out(); $d = 'Are'; $aa->out(); $d = 'You'; $aa->out(); //the output is "HiHowAreYou"
Example 2The code is as follows:
Name ;}}$ p = new person (); // note that the getName in the person class will not be reported whether it is added or not; however, this call has no meaning. $ name = & $ p-> getName (); $ name = 'Walker '; $ name = $ p-> getName (); echo $ name; // output walker
Supplement: The code returned by the function reference is as follows:
Tutorial address:
Reprinted! But please include the article address ^