I have a MySQL table with a tree data structure. The fields are _id, name and parentId. When the record hasn\'t a parent, parent
_id
name
parentId
parent
function toUL ($arr, $depth = 0) { // ... $html .= toUL($v['children'], $depth+1);