note 78745 added to function.explode
| From: | kevin at vanzonneveld dot net | Date: | Thu, 25 Oct 2007 15:44:36 +0000 |
| Subject: | note 78745 added to function.explode | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-131731@lists.php.net to get a copy of this message | ||
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/
----
Server IP: 83.137.20.135
Probable Submitter: 87.233.232.233
----
Manual Page -- http://www.php.net/manual/en/function.explode.php
Edit -- https://master.php.net/note/edit/78745
Del: integrated -- https://master.php.net/note/delete/78745/integrated
Del: useless -- https://master.php.net/note/delete/78745/useless
Del: bad code -- https://master.php.net/note/delete/78745/bad+code
Del: spam -- https://master.php.net/note/delete/78745/spam
Del: non-english -- https://master.php.net/note/delete/78745/non-english
Del: in docs -- https://master.php.net/note/delete/78745/in+docs
Del: other reasons-- https://master.php.net/note/delete/78745
Reject -- https://master.php.net/note/reject/78745
Search -- https://master.php.net/manage/user-notes.php