PHP在多维数组指定位置插入单元

WBOY
发布: 2016-07-29 09:08:49
原创
1161 人浏览过

<code><span>protected</span><span><span>function</span><span>_getSellerMenuList</span><span>()</span> {</span><span>$menu_list</span> = <span>array</span>(
  <span>'goods'</span> => <span>array</span>(<span>'name'</span> => <span>'商品'</span>, <span>'child'</span> => <span>array</span>(
    <span>array</span>(<span>'name'</span> => <span>'商品发布'</span>, <span>'act'</span>=><span>'goods_add'</span>, <span>'op'</span>=><span>'index'</span>),
    <span>array</span>(<span>'name'</span> => <span>'淘宝导入'</span>, <span>'act'</span>=><span>'import'</span>, <span>'op'</span>=><span>'index'</span>),
    <span>array</span>(<span>'name'</span> => <span>'出售中的商品'</span>, <span>'act'</span>=><span>'online'</span>, <span>'op'</span>=><span>'index'</span>),
    <span>array</span>(<span>'name'</span> => <span>'仓库中的商品'</span>, <span>'act'</span>=><span>'offline'</span>, <span>'op'</span>=><span>'index'</span>),
    <span>array</span>(<span>'name'</span> => <span>'关联版式'</span>, <span>'act'</span>=><span>'store_plate'</span>, <span>'op'</span>=><span>'index'</span>),
    <span>array</span>(<span>'name'</span> => <span>'商品规格'</span>, <span>'act'</span> => <span>'spec'</span>, <span>'op'</span> => <span>'index'</span>),
    <span>array</span>(<span>'name'</span> => <span>'图片空间'</span>, <span>'act'</span>=><span>'album'</span>, <span>'op'</span>=><span>'album_cate'</span>),
 )),
 <span>'promotion'</span> => <span>array</span>(<span>'name'</span> => <span>'促销'</span>, <span>'child'</span> => <span>array</span>(
    <span>array</span>(<span>'name'</span> => <span>'抢购管理'</span>, <span>'act'</span>=><span>'groupbuy'</span>, <span>'op'</span>=><span>'index'</span>),
    <span>array</span>(<span>'name'</span> => <span>'代金券管理'</span>, <span>'act'</span>=><span>'voucher'</span>, <span>'op'</span>=><span>'list'</span>),
    <span>array</span>(<span>'name'</span> => <span>'活动管理'</span>, <span>'act'</span>=><span>'activity'</span>, <span>'op'</span>=><span>'activity'</span>),
    <span>array</span>(<span>'name'</span> => <span>'申请授权'</span>, <span>'act'</span> =><span>'accredit'</span>, <span>'op'</span>=><span>'list'</span>),
    <span>array</span>(<span>'name'</span> => <span>'会员管理'</span>, <span>'act'</span>=><span>'membercard'</span>, <span>'op'</span>=><span>'list'</span>)
 ))
);
<span>if</span> (!checkPlatformStore()) {
  <span>$points</span> = <span>array</span>(<span>'name'</span> => <span>'积分管理'</span>,<span>'act'</span>=><span>'points'</span>,<span>'op'</span>=><span>'index'</span>);
  <span>/*array_splice(array,start,lenght,array) 第四个参数使用数组的话
   用array再包一下,否则当字符串来识别,多维数组伤不起啊……/(ㄒoㄒ)/~~ */</span>
  array_splice(<span>$menu_list</span>[<span>'promotion'</span>][<span>'child'</span>],<span>2</span>,<span>0</span>,<span>array</span>(<span>$points</span>));
}
  <span>return</span><span>$menu_list</span>;
}</code>
登录后复制
').addClass('pre-numbering').hide(); $(this).addClass('has-numbering').parent().append($numbering); for (i = 1; i ').text(i)); }; $numbering.fadeIn(1700); }); });

以上就介绍了PHP在多维数组指定位置插入单元,包括了方面的内容,希望对PHP教程有兴趣的朋友有所帮助。

相关标签:
来源:php.cn
本站声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板