Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/290.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 数组_unique错误地丢弃值_Php_Array Unique - Fatal编程技术网

Php 数组_unique错误地丢弃值

Php 数组_unique错误地丢弃值,php,array-unique,Php,Array Unique,我试图使用array_unique来丢弃重复的值 Array ( [0] => Array ( [book_id] => 1203910329 [author] => Gauci, Joe [description] => Paperback. Very Good. [isbn] => 9781907374067 [publ

我试图使用array_unique来丢弃重复的值

Array
(
    [0] => Array
        (
            [book_id] => 1203910329
            [author] => Gauci, Joe
            [description] => Paperback. Very Good.
            [isbn] => 9781907374067
            [publisher] =>
            [date] =>
            [currency] => USD
            [price] => 10.97
            [bookseller] => xx
            [bookseller_location] => GBR
            [condition] => 3
            [shipping_ground] => 4.73
            [shipping_expedited] => 6.33
        )

    [1] => Array
        (
            [book_id] => 12312314556
            [author] => Gauci, Joe
            [description] => Paperback. GOOD.
            [isbn] => 9781907374067
            [publisher] =>
            [date] =>
            [currency] => USD
            [price] => 1.84
            [bookseller] => xx
            [bookseller_location] => GBR
            [condition] => 2.5
            [shipping_ground] => 4.73
            [shipping_expedited] => 6.33
        )

    [2] => Array
        (
            [book_id] => 12312314556
            [author] => Gauci, Joe
            [description] => Paperback. GOOD.
            [isbn] => 9781907374067
            [publisher] =>
            [date] =>
            [currency] => USD
            [price] => 1.84
            [bookseller] => xx
            [bookseller_location] => GBR
            [condition] => 2.5
            [shipping_ground] => 4.73
            [shipping_expedited] => 6.33
        )

)
每次使用
array\u unique($results)
时,只返回第一个值

 Array
    (
        [0] => Array
            (
                [book_id] => 1203910329
                [author] => Gauci, Joe
                [description] => Paperback. Very Good.
                [isbn] => 9781907374067
                [publisher] =>
                [date] =>
                [currency] => USD
                [price] => 10.97
                [bookseller] => xx
                [bookseller_location] => GBR
                [condition] => 3
                [shipping_ground] => 4.73
                [shipping_expedited] => 6.33
            )
    )
使用
array\u unique

你不能使用嵌套数组。使用的比较清楚地记录在案:
(string)$elem1==(string)$elem2

不能与嵌套数组一起使用。使用的比较清楚地记录在案:
(string)$elem1==(string)$elem2

不能与嵌套数组一起使用。使用的比较清楚地记录在案:
(string)$elem1==(string)$elem2

不能与嵌套数组一起使用。使用的比较清楚地记录在案:
(string)$elem1==(string)$elem2

你的数据源是什么?你的数据源是什么?你的数据源是什么?