PHP if string contains URL isolate it

Posted by Dylan Taylor on Stack Overflow See other posts from Stack Overflow or by Dylan Taylor
Published on 2010-06-06T18:52:52Z Indexed on 2010/06/06 19:02 UTC
Read the original article Hit count: 244

Filed under:
|
|
|
|

In PHP, I need to be able to figure out if a string contains a URL. If there is a URL, I need to isolate it as another separate string.

For example: "SESAC showin the Love! http://twitpic.com/1uk7fi"

I need to be able to isolate the URL in that string into a new string. At the same time the URL needs to be kept intact in the original string. Follow?

I know this is probably really simple but it's killing me.

© Stack Overflow or respective owner

Related posts about php

Related posts about url