2014-12-28 11:02:20 3113次浏览 1条回答 0 悬赏 105 金钱
 function gen_tree($items, $id = 'id', $pid = 'pid', $son = 's') {
		$tree = array();
		$tmpMap = array();
	
		foreach ($items as $item) {
			$tmpMap[$item[$id]] = $item;
		}
		foreach ($items as $key => $item) {
			if (isset($tmpMap[$item[$pid]])) {

				$tmpMap[$item[$pid]][$son][] = &$tmpMap[$item[$id]];
				
			} else {
				$tree[] = &$tmpMap[$item[$id]];
			}
		}
		//print_r(CJSON::encode($tmpMap));
		unset($tmpMap);
		
		return $tree;
	}

报错:Indirect modification of overloaded element of Menu has no effect

补充于 2014-12-28 13:17

为什么没有人回答?啊啊

补充于 2017-05-23 17:26

知道原因了,已解决

您需要登录后才可以回答。登录 | 立即注册
a456003
助理

a456003

注册时间:2013-08-01
最后登录:2018-10-31
在线时长:11小时6分
  • 粉丝1
  • 金钱5
  • 威望0
  • 积分115

热门问题