note 86028 added to function.ereg-replace
| From: | info at webmedia-center dot com | Date: | Tue, 30 Sep 2008 08:09:36 +0000 |
| Subject: | note 86028 added to function.ereg-replace | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-144894@lists.php.net to get a copy of this message | ||
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;
}
----
Server IP: 89.31.146.176
Probable Submitter: 82.246.47.203
----
Manual Page -- http://www.php.net/manual/en/function.ereg-replace.php
Edit -- https://master.php.net/note/edit/86028
Del: integrated -- https://master.php.net/note/delete/86028/integrated
Del: useless -- https://master.php.net/note/delete/86028/useless
Del: bad code -- https://master.php.net/note/delete/86028/bad+code
Del: spam -- https://master.php.net/note/delete/86028/spam
Del: non-english -- https://master.php.net/note/delete/86028/non-english
Del: in docs -- https://master.php.net/note/delete/86028/in+docs
Del: other reasons-- https://master.php.net/note/delete/86028
Reject -- https://master.php.net/note/reject/86028
Search -- https://master.php.net/manage/user-notes.php