生成无限分类的结构
public function get_tree_1(array $list = array())
{
$root = array();
$node = array();
foreach ($list as $k => $v) {
list($id, $pid, $name, $path) = array_values($v);
$node[$id] = $v;
if(isset($node[$pid])) {
$node[$pid]['child'][$id] = &$node[$id];
}
if($pid == 0) {
$root[$id] = &$node[$id];
}
}
return $root;
}