note 86028 deleted from function.ereg-replace by danbrown

[email protected]
Newsgroups php.notes
Message-ID <[email protected]>
Note Submitter: info at webmedia-center dot com
Reason: non-english

----

donc Voilà, fonction hyperlink qui fonctionne (avec les emails en plus)

hyperlink($text) {
	$text = ereg_replace("[a-zA-Z]+://([-]*[.]?[a-zA-Z0-9_/-?&%])*", "<a href=\"\\0\">\\0</a>", $text);
	$text = ereg_replace("(^| |.)(www([-]*[.]?[a-zA-Z0-9_/-?&%])*)", "\\1<a href=\"http://\\2\">\\2</a>", $text);
	$text = ereg_replace("[a-zA-Z0-9_-|\.]+@[a-zA-Z0-9_-]+.[[:alpha:]]{2,5}", "<a href=\"mailto:\\0\">\\0</a>", $text);
	return $text;
	}
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.