How to get unique value in multidimensional array

前端 未结 8 1226
盖世英雄少女心
盖世英雄少女心 2020-12-01 03:34

I have done a lot of looking around on the overflow, and on google, but none of the results works for my specific case.

I have a placeholder array called $holder, va

8条回答
  •  旧时难觅i
    2020-12-01 04:24

    Just iterate over it and apply an array_unique on the result:

    foreach($holder as $yourValues){
        $pids[] = $yourValues['pid'];
    }
    $yourUniquePids = array_unique($pids);
    

提交回复
热议问题