12-08-2007, 01:13 AM
|
#12 (permalink)
|
|
The Frequenter
Join Date: Sep 2007
Posts: 360
Thanks: 24
|
Quote:
Originally Posted by Wildhoney
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.
|
Thanks, got that. 
|
|
|
|