I have two multidimensional arrays, both with email address data, but different keys, that I'm trying to compare. I need to get all of the email addresses that don't exist in both arrays, and store them. Is there a way I can speed this up?
$accts: id, Email, column1 - 13000 rows
$db_accts: id1, name, accountID,Email_Address__c - 17000 rows
Right now I have
foreach($accts as $acct){
$exists = false;
foreach($db_accts as $db_acct){
if($acct['Email'] == $db_acct['Email_Address__c'])
{ $exists = true;}
}
if(!$exists)
{ $update[] = array('Email'=>$acct['Email'],'column1'=>'');
}
}
foreach($db_accts as $db_acct){
$exists = false;
foreach($accts as $acct){
if($acct['Email'] == $db_acct['Email_Address__c'])
$exists = true;
}
if(!$exists)
{
$update[] = array('Email'=>$db_acct['Email_Address__c'],'column1'=>'Y');
}
}