note 48622 added to function.ereg-replace
| From: | (removedashes) | Date: | Sun, 02 Jan 2005 11:50:57 +0000 |
| Subject: | note 48622 added to function.ereg-replace | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-82563@lists.php.net to get a copy of this message | ||
[enEmy]Master.cz's code has a little bug. The first line would turn any link protocol into
http. The correct line is:
<?
$text = ereg_replace("([[:alpha:]]+://)([^<>[:space:]]+[[:alnum:]/])","<a
href=\"\\0\">\\0</a>", $text);
?>
----
Manual Page -- http://www.php.net/manual/en/function.ereg-replace.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+48622
Delete -- http://master.php.net/manage/user-notes.php?action=delete+48622&report=yes
Reason: bad code -- http://master.php.net/manage/user-notes.php?action=delete+48622&report=yes&reason=bad+code
Reason: spam -- http://master.php.net/manage/user-notes.php?action=delete+48622&report=yes&reason=spam
Reason: useless example -- http://master.php.net/manage/user-notes.php?action=delete+48622&report=yes&reason=useless+example
Reason: contains commercial links -- http://master.php.net/manage/user-notes.php?action=delete+48622&report=yes&reason=contains+commercial+links
Reason: useless note -- http://master.php.net/manage/user-notes.php?action=delete+48622&report=yes&reason=useless+note
Reject -- http://master.php.net/manage/user-notes.php?action=reject+48622&report=yes
Search -- http://master.php.net/manage/user-notes.php