12-07-2007, 09:03 PM
|
#10 (permalink)
|
|
La Vida es Sueño
Join Date: Sep 2007
Location: Oldham
Posts: 2,280
Thanks: 90
|
In extension to Karl's, consider this:
In the above example, both $a and $b now equal 2 because $b has been set as a reference to $a and so whatever $b becomes, $a becomes as well.
In a more complicated example:
php Code:
$aArray = array('Apple', 'Orange', 'Kiwi', 'Pear'); $pItem =& $aArray[ 2]; $pItem = 'Pitaya';
As $pItem is now a reference to the third item in our array, changing its value will also change the value in the array, so Kiwi now becomes Pitaya.
__________________
The man who comes back through the Door in the Wall will never be quite the same as the man who went out.
|
|
|