note 26047 added to function.preg-replace
| From: | chris at t3c dot de | Date: | Wed, 16 Oct 2002 09:20:38 +0000 |
| Subject: | note 26047 added to function.preg-replace | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-38151@lists.php.net to get a copy of this message | ||
this expression is optimized for all expressions. no matter if there is & or ? in the string!
$string =~ s/\s(http:\/\/\S+|www\.\S+|http:\/\/www\.\S+)\s/ <a
href="$1">$1<\/a> /gm;
$string =~ s/\s(\S+@\S+\.\w+)\s/ <a href=mailto:"$1">$1<\/a> /gm;
have fun
--
http://www.php.net/manual/en/function.preg-replace.php
http://master.php.net/manage/user-notes.php?action=edit+26047
http://master.php.net/manage/user-notes.php?action=delete+26047
http://master.php.net/manage/user-notes.php?action=reject+26047