flurin-d
4/29/2016 - 11:44 AM

add anchors to found emails inside a string

add anchors to found emails inside a string

	function parseEmails($string) {
		return preg_replace('([a-z0-9][_a-z0-9.-]+@([0-9a-z][_0-9a-z-]+\.)+[a-z]{2,6})','<a href="mailto:$0">$0</a>', $string);
	}