软件开发、小程序制作、系统集成与运维、空间租用、硬件开发、视频监控、技术咨询与支持——联系电话:0311-88999002/88999003
$tree = array();foreach ($list as $id => $row) { $pid = $row->pid; if ($pid == 0) {$tree[] = &$list[$id]; } else if (isset($list[$pid])) {$parent = &$list[$pid];$parent->children[] = &$list[$id];// 增加 children 属性标识子分类列表 }}