function ic($o, $d, &$md = 0, &$ml = 0) { if ($d > $md) { $md = $d; } if (!is_array($o)) { $l = strlen($o) - 1; if ($l > $ml) { $ml = $l; } return; } foreach ($o as $v) { ic($v, $d + 1, $md, $ml); } }
<li<?php ic($_UDI, 'default::account/index', ' class="current"'); ?> ><a href="<?php echo url('default::account'); ?> ">我的账户</a></li> <li<?php ic($_UDI, 'default::service/index', ' class="current"'); ?> ><a href="<?php echo url('default::service'); ?> ">我的服务</a></li> <li<?php ic($_UDI, 'default::service/invoice', ' class="current"'); ?> ><a href="<?php echo url('default::service/invoice'); ?> ">我的账单</a></li> <?php } ?> <?php if (Q::ini('isAdmin')) { ?> <li style="float: right;"><a href="<?php echo url('manage::default/index'); ?> ">管理中心</a></li>
<li<?php ic($_UDI, 'manage::account/traffic', ' class="current"'); ?> ><a href="<?php echo url('manage::account/traffic'); ?> ">流量日志</a></li> <li<?php ic($_UDI, 'manage::account/online', ' class="current"'); ?> ><a href="<?php echo url('manage::account/online'); ?> ">在线用户</a></li> <li<?php ic($_UDI, 'manage::radius/index', ' class="current"'); ?> ><a href="<?php echo url('manage::radius/index'); ?> ">Radius</a></li> <li style="float: right;"><a href="<?php echo url('default::default/index'); ?> ">前台首页</a></li> </ul> <div style="clear:both;"></div> </div> <div class="main">