I have an array $mycontacts of beans of type $contact
where:
$contact->id = $x
$contact->name = $y
$contact->email= $z
I want to check the $mycontacts array against a second array $contacted also of type $contact.
I want to perform $mycontacts - $contacted to yield a subset which I have not contacted based on the email parameter. Now i could do something like
foreach ($mycontacts as $mycontact) {
loop through $contacted and compare $contacted->email to $mycontact->email
}
Is there a better way to do this either with php, redbean or mysql?