note 13444 added to function.eregi-replace.php
| From: | raful at rafl dot co dot il | Date: | Sat, 16 Jun 2001 23:31:55 +0000 |
| Subject: | note 13444 added to function.eregi-replace.php | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-14337@lists.php.net to get a copy of this message | ||
I took LexZEUS's code, and improve it a bit:
<?
$url = "<HTML><BODY>
http://www.al-e_x.com/wh_at.php?what=2123123123&what=2123123123
<br>https://www.al-e_x.com/wh_at.php?what=2123123123&what=2123123123
<br>ftp://www.al-e_x.com/wh_at.php?what=2123123123
<br>mailto:alex@what_who_where-xyz.com
</BODY></HTML>";
$url = eregi_replace(
"((http|https|mailto|ftp):(\/\/)?[^[:space:]<>]{1,})",
"<a href='\\1'>\\1</a>",$url);
print $url;
?>
Raful
http://www.php.net/manual/en/function.eregi-replace.php