PHP实现正则表达式抽取email地址函数 PHP代码


# PHP实现正则表达式抽取email地址函数
function extract_emails_from($string) {
	//加入对#的判断,这个你懂的^_^ http://blog.ddian.cn
	preg_match_all("/[\._a-zA-Z0-9-]+(@|#)[\._a-zA-Z0-9-]+/i", $string, $matches);
	return $matches[0];
}


签名:这个人很懒,什么也没有留下!
最新回复 (0)
返回