重複した配列を削除すると同時に、新しいキー「重複」と重複の総数を元の配列に追加したいと考えています。PHPを使用してこれを行う最良の方法は何ですか?
Array
(
[0] => Array
(
[w] => 10
[r] => 10
[e] => 489
)
[1] => Array
(
[w] => 10
[r] => 10
[e] => 489
)
[2] => Array
(
[w] => 10
[r] => 10
[e] => 489
)
[3] => Array
(
[w] => 20
[r] => 20
[e] => 489
)
[4] => Array
(
[w] => 10
[r] => 10
[e] =>
)
)
次のようになります。
Array
(
[0] => Array
(
[w] => 10
[r] => 10
[e] => 489
[duplicates] => 2
)
[3] => Array
(
[w] => 20
[r] => 20
[e] => 489
)
[4] => Array
(
[w] => 10
[r] => 10
[e] =>
)
)