/ Published in: PHP
Thank you Jonathan Sampson for posting this on http://stackoverflow.com/questions/2050789/php-search-a-string-for-a-email-address
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<?php preg_match("/[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})/i", $content, $matches); print $matches[0]; ?>