Look into Regular Expressions.
See here: http://komunitasweb.com/2009/03/10-practical-php-regular-expression-recipes/
You are given several methods for extracting phone numbers and emails from a string, with PHP and regexpressions.
$email = "test@example.com";
if (preg_match('/^[^0-9][a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)*[@][a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)*[.][a-zA-Z]{2,4}$/',$email)) {
echo "Your email is ok.";
} else {
echo "Wrong email address format";
}
You can modify that to pull the email address out with a while loop, and store in an array with a $i++ to denote where it will be saved to. For the phone numbers, use this:
$phone = "(021)423-2323";
if (preg_match('/\(?\d{3}\)?[-\s.]?\d{3}[-\s.]\d{4}/x', $phone)) {
echo "Your phone number is ok.";
} else {
echo "Wrong phone number.";
}