note 78745 deleted from function.explode by tularis
| From: | tularis@php.net | Date: | Mon, 27 Oct 2008 13:04:34 +0000 |
| Subject: | note 78745 deleted from function.explode by tularis | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-145815@lists.php.net to get a copy of this message | ||
Note Submitter: kevin at vanzonneveld dot net
----
We've written a function: explodeTree() that can explode any single-dimensional array into a
full blown tree. The function uses a user-specified delimiter found in the keys of the original
array to separate nodes and determine hierarchy.
Sample: with 3 lines of code you could have a full directory hierarchy in a multi-dimensional array
if you specify the delimiter to be a '/' (slash).
I'm posting a link because the function is being improved by site visitors commenting on the
article:
http://kevin.vanzonneveld.net/techblog/article/72/