Re: wrapping anchor tags around a URL
| From: | Ahmed Saad | Date: | Wed, 25 Jan 2006 16:59:32 +0000 |
| Subject: | Re: wrapping anchor tags around a URL | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-229249@lists.php.net to get a copy of this message | ||
On 1/25/06, Ahmed Saad <ahmed.lists@gmail.com> wrote:
> On 1/23/06, Richard K Miller <richardkmiller@gmail.com> wrote:
>
> > function link_the_links($s) {
> > return preg_replace('@(http://[^\s]+)@sm', '<a
> > href="$1">$1</a>', $s);
> > }
> if ($s[strlen($s)-1] == '.'){
> $s = substr($s, 0, -1);
> }
oops! sorry i thought $s had only one link (per time) no all of them
-ahmed