i have a table like this:
+----+--------+-------+
| id | parent | title |
+----+--------+-------+
| 1 | NULL | yek |
| 2 | NULL | do |
| 3 | 1 | se |
| 4 | 3 | char |
+----+--------+-------+
and i need to get array of Hierarchical data like this. what is the best way ?
Array
(
[1] => Array
(
[3] => Array
(
[4] =>
)
)
[2] =>
)
please help me.