PHP在多維數組指定位置插入單元

WBOY
發布: 2016-07-29 09:08:49
原創
1159 人瀏覽過

<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
熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板