I have a block of text from which I want to extract the valid e-mail addresses and put them into an array. So far I have...
$string = file_get_contents(\
Your code is almost perfect, you just need to replace preg_match(...) with preg_match_all(...)
preg_match(...)
preg_match_all(...)
http://www.php.net/manual/en/function.preg-match.php
http://www.php.net/manual/en/function.preg-match-all.php