View Single Post
Old 06-11-2009, 10:19 AM   #4 (permalink)
Sakakuchi
The Contributor
 
Sakakuchi's Avatar
 
Join Date: Feb 2009
Posts: 64
Thanks: 1
Sakakuchi is on a distinguished road
Default

dscreck is right - it's quite annoying.

Still you could shorten the whole function somehow like that:

PHP Code:
function extractEmail($string)
{
$regEx "/([\s]*)[\._a-zA-Z0-9-]+@[\._a-zA-Z0-9-]+/i";
preg_match_all($regEx$string$emails);

return 
$emails;

(There might be some errors still - since it's not tested)
Sakakuchi is offline  
Reply With Quote