/**
* 把多维数组转化为二维数组
* @staticvar array $result
* @param <type> $data
* @return <type>
*/
public function array_multi2single($data){
static $result=array();
foreach($data as $value){
if(isset($value['children']) && is_array($value['children'])){
$temp = $value;unset($temp['children']);
$result[$value['id']] = $temp;
$this->array_multi2single($value['children']);
}else{
$result[$value['id']]=$value;
}
}
return $result;
}
* 把多维数组转化为二维数组
* @staticvar array $result
* @param <type> $data
* @return <type>
*/
public function array_multi2single($data){
static $result=array();
foreach($data as $value){
if(isset($value['children']) && is_array($value['children'])){
$temp = $value;unset($temp['children']);
$result[$value['id']] = $temp;
$this->array_multi2single($value['children']);
}else{
$result[$value['id']]=$value;
}
}
return $result;
}