how do you extract all email addresses from a string and put each extracted email address as an element of a simple array?
<?php
// define and implement your php function here
function get_all_emails($text_field) {
// ---- Beginning of Green Section ---
// create an empty array
$emails = array();
// implement the function. this function should extract
// all emails from $text_field and put them in $emails
// ---- End of Green Section ---
return $emails;
}
// your main code
$example1 = "person-1@here.com, person_2@there.net; person.3@wayoverthere.com";
$response = get_all_emails($example1);
// use print_r to test the result
echo "<pre>";
print_r($response);
echo "</pre>";
?>