让我解释一下我的情况,我得到了一个多维数组。下面是print_r我的数组。
Array
(
[0] => Array
(
[firstname] => Tinga
[lastname] =>
[email] => private@information.nl
[country_code] => NL
[group] => B2B
[order_count] => 321
)
[1] => Array
(
[firstname] => Tinga
[lastname] =>
[email] => private@information.nl
[country_code] => NL
[group] => B2B
[order_count] => 12
)
[2] => Array
(
[firstname] => Rijsbergen Automotive B.V.
[lastname] =>
[email] => private@information1.nl
[country_code] => NL
[group] => B2B
[order_count] => 311
)
[3] => Array
(
[firstname] => Mike Verhoef
[lastname] => Artis Garage Amsterdam
[email] => private@information2.nl
[country_code] => NL
[group] => B2B
[order_count] => 260
)
[4] => Array
(
[firstname] => Marc Kraak
[lastname] => Vakgarage TEMA
[email] => private@information3.nl
[country_code] => NL
[group] => B2B
[order_count] => 257
)
[5] => Array
(
[firstname] => J&B Auto's
[lastname] =>
[email] => private@information4.nl
[country_code] => NL
[group] => B2B
[order_count] => 249
)
)
如您所见,有一个重复的数组,只有order_count不同的。
我可以使用 轻松删除重复项array_unique,但随后它会随机删除其中一个数组(我相信)。
我想要的是基于电子邮件(private_information)以最少的order_count. (所以只保留最高的那个order_count)
任何人都可以在这里帮助我吗?
Smart猫小萌