Good evening everyone. I need your advice professionals. I have an array (this is data from LDAP) in which there are identical users with names (displayname), but they have different email addresses. How can I choose those who have yandex.ru in their email (in fact, AD has the same user as User and Contact. And I have to select the contact, since he has yandex.ru email address. But this is a digression ...). I think it’s about sorting or even grouping.
$entries[1]["displayname"][0]='Alex'; $entries[1]["email"][0]='123@mail.ru'; $entries[2]["displayname"][0]='Alex'; $entries2[2]["email"][0]='256@yandex.ru'; $entries[3]["displayname"][0]='Ann'; $entries[3]["email"][0]='789@mail.ru'; $entries[4]["displayname"][0]='Ann'; $entries[4]["email"][0]='555@yandex.ru';
foreach($entries as $entry){if(strpos($entry["email"][0], "@yandex.ru") !== false) echo "YES";}- rjhdby$entriesand$entries2? - Raz Galstyanarray_filter($entries, function($v){ return stristr($v['email'][0], "@yandex.ru"); });- teran