Convert a Single Dimensional Array to a Full Blown Tree Structure in PHP


From a Data Structure perspective, here, I will demonstrate how to convert a single dimensional array to a full blown tree structure in PHP. Array is PHP is really flexible. PHP array is actually ordered dictionary. It can be used to represent arrays, lists, queues, stacks, trees, with use of references even graphs. What is more it’s fast. What more could you want? So, here I start with an example with a directory. Continue reading