PEAR::Tree walk function usage
| From: | Jeroen Houben | Date: | Wed, 12 Feb 2003 12:14:04 +0000 |
| Subject: | PEAR::Tree walk function usage | ||
| References: | 1 2 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-3701@lists.php.net to get a copy of this message | ||
Hi Wolfram,
I have a tree with chapters and subchapters (and subchapters ...)
Now I want to modify some values in that tree and I thought that the walk function could do the trick, but I can't get it right. I want to do the following (these are just example trees):
Convert:
Chapter on Horses
-- subchapter
-- subchapter
------sub sub chapter
------sub sub chapter
Chapter on Camels
-- subchapter
-- subchapter
------sub sub chapter
------sub sub chapter
Into:
1.Chapter on Horses
-- 1.1subchapter
-- 1.2subchapter
------ 1.2.1sub sub chapter
------ 1.2.2sub sub chapter
2. Chapter on Camels
-- 2.1subchapter
------2.1.1.sub sub chapter
------2.1.2sub sub chapter
-- 2.2subchapter
------2.2.1sub sub chapter
------2.2.2sub sub chapter
I know there are some clever functions (like the walk one) hiding away in your class. Could you point me in the right direction?
Thanks
Jeroen