I don't have a background in CS or data structures. I want to make a PHP class that stores a [modified preorder transversal tree](http://mikehillyer.com/articles/managing-hierarchical-data-in-mysql/), for manipulation and syncing with a database. 

Basically I need to store data like:

```
+-------------+----------------------+-----+-----+
| category_id | name                 | lft | rgt |
+-------------+----------------------+-----+-----+
|           1 | ELECTRONICS          |   1 |  20 |
|           2 | TELEVISIONS          |   2 |   9 |
|           3 | TUBE                 |   3 |   4 |
|           4 | LCD                  |   5 |   6 |
|           5 | PLASMA               |   7 |   8 |
|           6 | PORTABLE ELECTRONICS |  10 |  19 |
|           7 | MP3 PLAYERS          |  11 |  14 |
|           8 | FLASH                |  12 |  13 |
|           9 | CD PLAYERS           |  15 |  16 |
|          10 | 2 WAY RADIOS         |  17 |  18 |
+-------------+----------------------+-----+-----+

```

I was thinking of using an array, but it seems cumbersome. If it were an array of arrays like this: `array( 'name'=> "PORTABLE ELECTRONICS", 'lft' => 10, 'rgt' = 19 )`, then it would get cumbersome to loop through that array repeatedly to make sure all numbers are present, etc. 

Since PHP has a few new data structures available, I wonder if any of these would get me any benefit over using an array?

* SplDoubly
* LinkedList
* SplStack
* SplQueue
* SplHeap
* SplMaxHeap
* SplMinHeap
* SplPriorityQueue
* SplFixedArray
* SplObjectStorage

---

**Edit:** This class isn't going to be a gateway to a tree stored in a database table. (If it were, I would just have a query of classes.) It's just a stand-alone mmpt in some kind of PHP data structure.