How to get unique value in multidimensional array

前端 未结 8 1225
盖世英雄少女心
盖世英雄少女心 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条回答
  •  一生所求
    2020-12-01 04:15

    Hi Please try code given below for get unique values and then sort that values

    ";
    print_r($sort_arr);
    echo"
    "; /*function for get unique value then sort them*/ function unique_sort($arrs, $id) { $unique_arr = array(); foreach ($arrs AS $arr) { if (!in_array($arr[$id], $unique_arr)) { $unique_arr[] = $arr[$id]; } } sort($unique_arr); return $unique_arr; }

    thanks

提交回复
热议问题