On 16/11/2007, Paul van Haren <[EMAIL PROTECTED]> wrote:
> I'm trying to use arrays to implement a sort of data tree. For the code to
> work, it is essential that the nodes can be edited after they have become
> part of the tree. That would require that the array elements are pushed
> "by reference" rather than "by value".
>
> <?php
>
> $arr1 = array ();
> $arr2 = array ();
>
> array_push ($arr1, 1);
> array_push ($arr1, $arr2); // <-- the important line
array_push ($arr1, &$arr2);
or
$arr1[] =& $arr2;
-robin
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php