How do I format Nested Set Model data into an array?
问题 Let's dig in the main problem right away, I have the input like this $category = array( 'A' => array('left' => 1, 'right' => 8), 'B' => array('left' => 2, 'right' => 3), 'C' => array('left' => 4, 'right' => 7), 'D' => array('left' => 5, 'right' => 6), 'E' => array('left' => 9, 'right' => 10), ); I want the output to be something like this $tree = array( array('A', 'B'), array('A', 'C', 'D'), array('E'), ); which one is the best and fast function to loop though the input array and create the