[PHP] Tree-like structure in PHP?

2007-11-16 Thread Paul van Haren
by value print_r ($arr1); echo Expected output:\n; $arr1[1] = $arr2; print_r ($arr1); ? What is the most obvious way to implement a tree-like structure in PHP? Is there a way to push arrays by reference rather than by value? BTW: I'm using PHP CLI version

Re: [PHP] Tree-like structure in PHP? (closed)

2007-11-16 Thread Jochem Maas
Paul van Haren wrote: Thanks, the empasant helps! ampersand :-) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Tree-like structure in PHP?

2007-11-16 Thread Richard Heyes
What is the most obvious way to implement a tree-like structure in PHP? Use someone elses code that already works. :) Array based tree class is here: http://www.phpguru.org/Tree/Tree.phps -- Richard Heyes +44 (0)800 0213 172 http://www.websupportsolutions.co.uk Knowledge Base and HelpDesk

Re: [PHP] Tree-like structure in PHP?

2007-11-16 Thread Robin Vickery
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

Re: [PHP] Tree-like structure in PHP?

2007-11-16 Thread Jochem Maas
// apparently $arr2 is inserted by value print_r ($arr1); echo Expected output:\n; $arr1[1] = $arr2; print_r ($arr1); ? What is the most obvious way to implement a tree-like structure in PHP? Is there a way to push arrays by reference rather than

Re: [PHP] Tree-like structure in PHP? (closed)

2007-11-16 Thread Paul van Haren
Thanks, the empasant helps! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php