Extract links from strings
| From: | Jônatas Zechim | Date: | Mon, 21 Sep 2009 15:52:12 +0000 |
| Subject: | Extract links from strings | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-298236@lists.php.net to get a copy of this message | ||
Hi there, i've the following strings:
$string1 = 'Lorem ipsum dolor http://site.com sit amet';
$string2 = 'Lorem ipsum dolor http://www.site.com/ sit
amet';
$string3 = 'Lorem ipsum dolor http://www.site.net sit
amet';
How can I extract the URL from these strings?
They can be [http:// + url] or [www. + url].
Zechim