Re: STRING AND URL
| From: | David Newcomb | Date: | Mon, 26 Jun 2000 12:10:05 +0000 |
| Subject: | Re: STRING AND URL | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-3104@lists.php.net to get a copy of this message | ||
Try this:
<?php
$string="this is a string www.url.com with stuff after it";
$newstring = ereg_replace("(www.[a-zA-Z0-9.]*)", "<a
href=\"http://\\1\">\\1</a>",$string);
echo "$newstring";
?>
----- Original Message -----
From: Olivier ROBLE <olivier@siriade.fr>
To: <php-general@lists.php.net>
Sent: Monday, June 26, 2000 12:40 PM
Subject: [PHP-GENERAL] STRING AND URL
> hi,
>
> i would to know how i can easily parse a url into a string like that :
>
> my string : "this is a test with www.mytest.com"
> what i want : "this is a test with <a
>
> href="http://www.mytest.com">www.mytest.com</a>
>
> any ideas ?
> thx
>
> Olivier
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>