View Single Post
  #34 (permalink)  
Old 05-05-2008, 05:39 AM
senraj senraj is offline
D-Web Master
 
Join Date: Jul 2007
Posts: 418
senraj is on a distinguished road
Post Re: Operations in PHP

Hi,

By-Reference Assignment Operator PHP enables you to create variables
as aliases for other variables. You can achieve this by using the by-reference
assignment operator =&. After a variable aliases another variable, changes to
either one of them affects the other.
For example:
$name = "Judy";
$name_alias =& $name;
$name_alias = "Jonathan";
print $name;
The result of this example is
Jonathan
When returning a variable by-reference from a function (covered later in
this book), you also need to use the assign by-reference operator to assign the
returned variable to a variable:
$retval =& func_that_returns_by_reference();
__________________
Regards,
Senraj.A
Reply With Quote