PHP 二维数据去重

         $tj_recommend = [
            ['id' => 1, 'files_id' => 1],
            ['id' => 2, 'files_id' => 3],
            ['id' => 3, 'files_id' => 3],
            ['id' => 4, 'files_id' => 2],
            ['id' => 5, 'files_id' => 5],
            ['id' => 6, 'files_id' => 1],
            ['id' => 7, 'files_id' => 7],
            ['id' => 8, 'files_id' => 8],
            ['id' => 9, 'files_id' => 1]
        ];
        $arr = [];
        foreach($tj_recommend as $item){
            if(!in_array($item['files_id'], array_column($arr, 'files_id'))){
                $arr[] = $item;
            }
        }
        print_r($arr);exit;

34 thoughts on “PHP 二维数据去重

  1. Hey there would you mind letting me know which webhost you’re utilizing? I’ve loaded your blog in 3 completely different internet browsers and I must say this blog loads a lot faster then most. Can you suggest a good hosting provider at a honest price? Many thanks, I appreciate it!

  2. Very nice article and straight to the point. I don’t know if this is actually the best place to ask but do you people have any thoughts on where to employ some professional writers? Thx 🙂

  3. Thanks for sharing excellent informations. Your web-site is very cool. I’m impressed by the details that you’ve on this blog. It reveals how nicely you understand this subject. Bookmarked this website page, will come back for more articles. You, my friend, ROCK! I found simply the info I already searched all over the place and simply couldn’t come across. What a perfect web site.

回复 pink salt trick for weight loss 取消回复

您的电子邮箱地址不会被公开。 必填项已用*标注

Back To Top

鄂ICP备17008157号-1