note 16045 deleted from function.eregi-replace by jimw
| From: | jimw@php.net | Date: | Fri, 02 Nov 2001 02:09:05 +0000 |
| Subject: | note 16045 deleted from function.eregi-replace by jimw | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-20250@lists.php.net to get a copy of this message | ||
Since every code here has some bugs (some work only with http://xxx/
style, other only with www.xxx.com style) I have modified some code here and it works perfekt now
for me.
$text=eregi_replace("((ftp://)|(http://)|(www))(([a-z0-9.\-])*)(@)?(([a-z0-9\.])*)(([:/])?)((([a-z0-9]*)(@?)/*)+([.a-z]{2,4}){1})?((\??[a-z0-9\=]*)?)((\&[a-z0-9\=]*)?)(([\.a-z]){2,4})?",
"<a href=\"http://\\0\"
target=\"blank\">\\0</a>", $text);
$text=str_replace("http://http://","http://",$text);