note 9835 added to ereg_replace
| From: | schmidt at onlinepool dot de | Date: | Mon, 27 Nov 2000 11:32:10 +0000 |
| Subject: | note 9835 added to ereg_replace | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-8163@lists.php.net to get a copy of this message | ||
I made a little regexp that converts a
pattern for inserting links, to be used by users not familiar with html.
usage:
url::Name of Link:http://www.your-url-here.com
and here's my regexp:
ereg_replace("url::(([[:alnum:]]|[[:space:]])*):((ftp://)|(http://))(([[:alnum:]]|[[:punct:]])*)",
"<a href=\"\\5\\6\" target=\"_blank\">\\1</a>",$string);
http://www.php.net/manual/function.ereg-replace.php