array_unique/super_unique问题
我正在尝试根据以下数组的“duplicate_check”删除重复项。看来 array_unique 和 super_unique 函数都不起作用。我还尝试将两个相同的数组与循环函数内的循环进行比较,但它耗尽了时间,因为数组中有数万行。有什么帮助吗?
[1] => Array
(
[a] => abc
[b] => 202
[c] => 001
[d] =>
[e] => Graphic Commun
[duplicate_check] => abc202001
)
[2] => Array
(
[a] => abc
[b] => 211
[c] => 001
[d] => Bard
[e] => CAD Fundamentals
[duplicate_check] => abc211001
)
[3] => Array
(
[a] => abc
[b] => 211
[c] => 001
[d] =>
[e] =>
[duplicate_check] => abc211001
)
I am trying to remove duplicates based on 'duplicate_check' for the following array. It seems neither array_unique nor super_unique function works. I also tried to compare two identical arrays with a loop inside a loop function, but it runs out of time because there are tens of thousands lines in the array. Any help?
[1] => Array
(
[a] => abc
[b] => 202
[c] => 001
[d] =>
[e] => Graphic Commun
[duplicate_check] => abc202001
)
[2] => Array
(
[a] => abc
[b] => 211
[c] => 001
[d] => Bard
[e] => CAD Fundamentals
[duplicate_check] => abc211001
)
[3] => Array
(
[a] => abc
[b] => 211
[c] => 001
[d] =>
[e] =>
[duplicate_check] => abc211001
)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好吧,我不知道你尝试过的方法(你应该将其添加到你的问题中)。但看来你应该只使用循环来过滤条目:
一个懒惰的解决方案(但可能不适合你的任务)也可以是:
Well, I don't know about your tried approach (you should add that to your question). But it seems you should just use a loop to filter entries:
A lazy solution (but probably not to your task) could also be: