Assign variable by reference in PHP
Description
The following code shows how to assign variable by reference.
Example
/*from w w w.j av a2s . co m*/
<?php
//create variable
$a = "Apple";
//create references
$b = &$a;
//change value of both $a and $b
$a = "Ball";
//remove $a
unset($a);
//prints Ball
print($b);
?>
The code above generates the following result.