php正则表达式抽取email地址函数

[代码] [PHP]代码

1 function extract_emails_from($string) {
2 //加入对#的判断,这个你懂的^_^ http://blog.ddian.cn
3 preg_match_all("/[\._a-zA-Z0-9-]+(@|#)[\._a-zA-Z0-9-]+/i", $string, $matches);
4 return $matches[0];
5 }
posted @ 2013-02-04 11:45  幻星宇  阅读(232)  评论(0编辑  收藏  举报