您的位置:首页 > 其它

菜单分类多维数组中.每个数组添加一个id字段.可使用引用

2016-03-10 10:31 309 查看
<?php

$arr = array(

array("catid"=>"841","parentids"=>null,"childids"=>"842,843,943","name"=>"TV9","url"=>"http111"),

array("catid"=>"853","parentids"=>null,"childids"=>"854,855,856","name"=>"APP-ad","url"=>"http333"),

array("catid"=>"986","parentids"=>null,"childids"=>"988,989,990,991","name"=>"Appu64ad","url"=>"http666"),

array("catid"=>"987","parentids"=>null,"childids"=>"1015,1016,1017,1018","name"=>"Apbed","url"=>"http777"),

array("catid"=>"920","parentids"=>null,"childids"=>"922,921,923","name"=>"1APPd","url"=>"http0000")

);

foreach($arr as $k=>&$v){

$v['id'] = '000000'.$v['catid'];

}

echo '<pre>';

var_dump($arr);
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: