我需要计算重复的多维数组,删除此重复项并将重复计数推入新索引中。
假设我有这个数组:
Array
(
[0] => Array
(
[segments] => Array
(
[1] => Gcia de Auditoría Interna
[0] => Auditoria Interna 1
)
[groups] => Array
(
[estados] => sp
[cidade] => sumpaulo
)
)
[1] => Array
(
[segments] => Array
(
[2] => Gerencia Recursos Humanos
[1] => Gcia Dpto Admin de Pers. y Rel. Laboral
[0] => SubGcia Administración de Personal
)
[groups] => Array
(
[estados] => sp
[cidade] =>
)
)
[2] => Array
(
[segments] => Array
(
[2] => Gerencia Recursos Humanos
[1] => Gcia Dpto Admin de Pers. y Rel. Laboral
[0] => SubGcia Administración de Personal
)
[groups] => Array
(
[estados] => sp
[cidade] =>
)
)
)
我想删除重复的数组并创建一个新的索引计数:
Array
(
[0] => Array
(
[segments] => Array
(
[1] => Gcia de Auditoría Interna
[0] => Auditoria Interna 1
)
[groups] => Array
(
[estados] => sp
[cidade] => sumpaulo
)
[total] = 1
)
[1] => Array
(
[segments] => Array
(
[2] => Gerencia Recursos Humanos
[1] => Gcia Dpto Admin de Pers. y Rel. Laboral
[0] => SubGcia Administración de Personal
)
[groups] => Array
(
[estados] => sp
[cidade] =>
)
[total] = 2
)
)
可能吗?