I have this text

$string = "this is my friend's website http://example.com I think it is coll";
how can I extract the link into another variable

I know it should be by using regular expression especially "preg_match" but I don't know how?

Well, i have one whole page with url and i have to extract all links from the page.

Thanks in advance.