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
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
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
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
// 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
Thanks, the empasant helps!
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
6 matches
Mail list logo