note 91625 added to function.preg-replace
| From: | OrtwinGentz at osu1 dot php dot net | Date: | Fri, 19 Jun 2009 22:42:55 +0000 |
| Subject: | note 91625 added to function.preg-replace | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-157148@lists.php.net to get a copy of this message | ||
I'm trying to make @replies in Twitter messages hot:
$tweet = preg_replace("/(\W)\@(\w+)(\W|$)/", "$1<a href='http://twitter.com/$2'>@$2</a>$3",
$rawtweet);
This code only works for the 1st @reply although no limit has been set. It looks like it is not
possible to do this replacement in one function call.
----
Server IP: 212.124.37.9
Probable Submitter: 87.142.44.87
----
Manual Page -- http://www.php.net/manual/en/function.preg-replace.php
Edit -- https://master.php.net/note/edit/91625
Del: integrated -- https://master.php.net/note/delete/91625/integrated
Del: useless -- https://master.php.net/note/delete/91625/useless
Del: bad code -- https://master.php.net/note/delete/91625/bad+code
Del: spam -- https://master.php.net/note/delete/91625/spam
Del: non-english -- https://master.php.net/note/delete/91625/non-english
Del: in docs -- https://master.php.net/note/delete/91625/in+docs
Del: other reasons-- https://master.php.net/note/delete/91625
Reject -- https://master.php.net/note/reject/91625
Search -- https://master.php.net/manage/user-notes.php