一区二区久久-一区二区三区www-一区二区三区久久-一区二区三区久久精品-麻豆国产一区二区在线观看-麻豆国产视频

php多維數(shù)組去掉重復(fù)值示例分享

復(fù)制代碼 代碼如下:
<?php
$json='{

    "rec_items": [
        {
            "classes": "玄幻",
            "gid": 6326585,
            "author": "我吃西紅柿",
            "nid": 10079306,
            "last_sort": 841,
            "last_chapter_name": "第二十五卷 第六章 一掃而空",
            "sub_count": 5364424,
            "novel_name": "莽荒紀(jì)",
            "last_update_time": 1393679718826
        },
        {
            "classes": "玄幻",
            "gid": 6109786,
            "author": "唐家三少",
            "nid": 10079046,
            "last_sort": 1153,
            "last_chapter_name": "第三百八十一章 開始行動(dòng)(中)",
            "sub_count": 3933876,
            "novel_name": "絕世唐門",
            "last_update_time": 1393681654511
        },
        {
            "classes": "玄幻",
            "gid": 10645516,
            "author": "辰東",
            "nid": 12649548,
            "last_sort": 478,
            "last_chapter_name": "第四百三十二章 扛媳婦回村",
            "sub_count": 1422482,
            "novel_name": "完美世界",
            "last_update_time": 1393681655610
        },
        {
            "classes": "玄幻",
            "gid": 4711723,
            "author": "只是小蝦米",
            "nid": 12629406,
            "last_sort": 2603,
            "last_chapter_name": "第2588章 蘇醒!",
            "sub_count": 2841630,
            "novel_name": "武逆",
            "last_update_time": 1393605899300
        },
        {
            "classes": "玄幻",
            "gid": 3701669,
            "author": "蒼笑天",
            "nid": 8583556,
            "last_sort": 3427,
            "last_chapter_name": "第兩千兩百二十五章 孔雀王!",
            "sub_count": 606473,
            "novel_name": "武破九霄",
            "last_update_time": 1391279170831
        },
        {
            "classes": "玄幻",
            "gid": 8141499,
            "author": "風(fēng)凌天下",
            "nid": 9212380,
            "last_sort": 2579,
            "last_chapter_name": "第五百二十六章 九劫、天帝之戰(zhàn)【七】",
            "sub_count": 3082857,
            "novel_name": "傲世九重天",
            "last_update_time": 1393677692614
        }
    ],
    "cate_book_items": [
        {
            "classes": "玄幻",
            "gid": 4711723,
            "author": "只是小蝦米",
            "nid": 12629406,
            "last_sort": 2603,
            "last_chapter_name": "第2588章 蘇醒!",
            "sub_count": 2841630,
            "novel_name": "武逆",
            "last_update_time": 1393605899300
        },
        {
            "classes": "玄幻",
            "gid": 3701669,
            "author": "蒼笑天",
            "nid": 8583556,
            "last_sort": 3427,
            "last_chapter_name": "第兩千兩百二十五章 孔雀王!",
            "sub_count": 606473,
            "novel_name": "武破九霄",
            "last_update_time": 1391279170831
        },
        {
            "classes": "玄幻",
            "gid": 10645516,
            "author": "辰東",
            "nid": 12649548,
            "last_sort": 478,
            "last_chapter_name": "第四百三十二章 扛媳婦回村",
            "sub_count": 1422482,
            "novel_name": "完美世界",
            "last_update_time": 1393681655610
        }
    ]
}';

function mult_unique($array)
{
  $return = array();
  foreach($array as $key=>$v)
  {
    if(!in_array($v, $return))
    {
      $return[$key]=$v;
    }
  }
  return $return;
}

$json = get_object_vars(json_decode($json));
$data = $json['rec_items'];
$data = array_merge_recursive($data, $json['cate_book_items']);

echo '<pre>';
print_r($data);
echo '<br>';
print_r(mult_unique($data));
echo '</pre>';
?>

php技術(shù)php多維數(shù)組去掉重復(fù)值示例分享,轉(zhuǎn)載需保留來源!

鄭重聲明:本文版權(quán)歸原作者所有,轉(zhuǎn)載文章僅為傳播更多信息之目的,如作者信息標(biāo)記有誤,請第一時(shí)間聯(lián)系我們修改或刪除,多謝。

主站蜘蛛池模板: 亚洲黄色在线播放 | 国产亚洲精品福利片 | 久996视频精品免费观看 | 日本精品高清一区二区不卡 | 国产精品2020在线看亚瑟 | 五月天久草| 色婷婷在线视频 | 91精选视频 | 中文字幕在线视频一区 | 青青热久麻豆精品视频在线观看 | 久久婷婷一区二区三区 | 91麻豆国产精品91久久久 | 国内在线亚洲精品第一线 | 成人福利在线观看 | 中文字幕色站 | 又色又爽又黄的视频女女高清 | 色综合狠狠干 | 九九视频高清视频免费观看 | 国产h视频在线观看网站免费 | 激性欧美激情在线播放16页 | 欧美特黄一免在线观看 | 中文字幕精品一区 | 国内精品久久久久影院网站 | 91国在线啪精品一区 | 成年人激情网站 | 国产在线精品一区二区三区 | 五月婷婷狠狠 | 欧美三级网站 | 婷婷六月激情 | 五月婷亚洲 | 91在线网站 | 特黄视频免费看 | 欧美日韩一区二区三区自拍 | 久久精品成人 | va免费视频 | 二区视频 | www.成人在线视频 | 欧美黑人粗硬大在线看 | 六月婷婷综合网 | 91视频国产91久久久 | 欧美一级做一a做片性视频 欧美一级做一级做片性十三 |