/** * infinite recursive drop-down selection box * @param $data array * @param $pid parent ID * @param int $t Cycles: Action indent * @param int $selected selected subscript * @return string * @author Zhengjingqiang * @email s cenewood@163.com * @date 2015-10-22 */function html_options ($data =array (), $pid =0, $t =-1, $selected =0) {&
nbsp; $html _options = ';
$t + +;
$nbspstr = str_repeat (' ', $t * 4); if ($data) { foreach ($data as $k => $v) {  &N bsp; if ($pid = = $v [' pid ']) { //Determine if it is the last Drop-down tab $symbol _str = (count ($data) = = ($k + 1))?
' ┗ ': ' Out '; //Decide whether to select $selected _str = ($selected = = $v [' id '])?
' Selected= ' selected ': '; //dropdown selection box data $html _options. = ' <option Value= "'. $v [' id ']. "'. $selected _str. ' > '. $nbspstr. $symbol _str. $v [' name '].
' </option> '; //Infinite loop lookup subset $html _options. = Html_
Options ($data, $v [' id '], $t, $selected);
} }
} return $html _options; /** * Two-dimensional array recursive * @param array $arr * @return array * @author zhengjingqiang * @email scenewood@163.com function C Ategory ($arr = Array ()) { $info = array (); if (count ($arr) > 0) {   ; foreach ($arr as $k => $vo) { if ($vo [' pid '] = = 0) { foreach ($arr as $v) { if ($v [' pid '] = = $VO [' id ']) { $vo [' children '] = $v
; } } $info
[] = $vo;
} }
} return $info; /** * Infinite Classification * @param $array * @param int $pid * @return array * @author Zhengjingqiang &n bsp;* @email scenewood@163.com */function Menutree ($array, $pid) { $arr = array (); & nbsp foreach ($array as $v) { if ($v [' pid '] = = $pid) { &nbs
p; $tem = Menutree ($array, $v [' id ']); //Determine if there is a child array
$tem && $v [' child '] = $tem;
$arr [] = $v; } } return $arr;
}