我正在尝试使用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_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_unique
去哪里?
不能将array_unique
与嵌套数组一起使用。使用的比较有明确的文件记录:(string) $elem1 === (string) $elem2