I have a list. Everything should be displayed, BUT until they are found with the same name, such as Anna. And then Anna should remain, whose address is * mail.ru. But this is only if there is more than one with the same name. For example, Ivan should stay as he is alone. How to more concisely implement? The list is actually over 500 people.
$entries[0]["displayname"]="Ivan" $entries[0]["mail"]="123@mail" $entries[1]["displayname"]="Anna" $entries[1]["mail"]="aaa@yandex.ru" $entries[2]["displayname"]="Bob" $entries[2]["mail"]="bbb@yandex.ru" $entries[3]["displayname"]="Anna" $entries[3]["mail"]="123@mail.ru"