Link to home
Start Free TrialLog in
Avatar of sabecs
sabecs

asked on

PHP - find records in one array that rea not found in another array?

Hi,
I need to find records that are in the $remote_emails array that don't already exist in the $local_emails array.

Is there an easy way to do this?

Thanks

				echo "Local Emails</br>";
				$local_emails = array('abc@hotmail.com','john@hotmail.com','peter@hotmail.com','peter3@hotmail.com','peter4@hotmail.com','peters@hotmail.com');
				print_r($local_emails);
                
                echo "</br>";
				echo "Remote Emails</br>";
                
                $remote_emails = array('andrew@hotmail.com', 'peter@hotmail.com','peter_62@hotmail.com');
				print_r($remote_emails);
				
				
				//if email address from $remote_emails array does not exists in $local_emails array then echo it here

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Gary
Gary
Flag of Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of sabecs
sabecs

ASKER

Thanks Cathal.