【发布时间】:2017-06-17 12:52:07
【问题描述】:
我有一个关联多维数组:
Array
(
[0] => Array
(
[customer_name] => John Dow
[customer_email] => john@example.com
[customer_mobile] => 1236547895
[birth_date] => 12/1/1996
[status] => Enable
)
[1] => Array
(
[customer_name] => Alex
[customer_email] => alex@example.com
[customer_mobile] => 4563214785
[birth_date] => 19/1/1996
[status] => Enable
)
[2] => Array
(
[customer_name] => Arina
[customer_email] => arina@example.com
[customer_mobile] => 963214785
[birth_date] => 25/1/1996
[status] => Enable
)
[3] => Array
(
[customer_name] => Atom
[customer_email] => atom@example.com
[customer_mobile] => 5214789632
[birth_date] => 12/1/1998
[status] => Enable
)
[4] => Array
(
[customer_name] => Jennifer
[customer_email] => jennifer@example.com
[customer_mobile] => 4563214785
[birth_date] => 12/2/1996
[status] => Enable
)
)
现在我想检查 customer_mobile 和 customer_email 中的相似值以减少冗余。联系电话和电子邮件地址必须是非冗余的。
所以请指导我,我怎样才能做到这一点?谢谢:)
【问题讨论】:
-
发布想要的结果
-
我不想要任何结果。我只是想检查是否有任何客户有重复的联系电话和电子邮件地址。它作为标志返回 - true 表示该数组包含冗余
-
你写的 it return as flag - 一个标志用于所有项目或每个项目单独?
-
所有项目的标志 - 如果 1 个联系号码重复 2 次或更多次以及电子邮件。整个数组将被丢弃
标签: php arrays multidimensional-array array-unique