删除数组中的重复元素

时间:2014-09-09 00:06:30

标签: php

我有搜索SO但大多数结果与How to remove duplicate values from a multi-dimensional array in PHP

类似

我已尝试过array_unique,但无效。

  Array
    (
        [0] => Array
            (
                [0] => ball_24.gif
                [1] => ball_8.gif
                [2] => ball_1.gif
                [3] => ball_33.gif
                [4] => ball_43.gif
                [5] => ball_1.gif
                [6] => ball_8.gif
                [7] => ball_24.gif
                [8] => ball_33.gif
                [9] => ball_43.gif
            )

    )

1 个答案:

答案 0 :(得分:3)

$array[0] = array_unique($array[0]);