php string search - grabbing specific urls

Posted by MEM on Stack Overflow See other posts from Stack Overflow or by MEM
Published on 2011-02-10T15:06:00Z Indexed on 2011/02/10 15:25 UTC
Read the original article Hit count: 155

Filed under:
|

Hello,

I have this string that may contain some urls that I need to grab. For instance, if the user does:

www.youtube ...

or

www.vimeo ...

or

http://www.youtube ...

or

HttP://WwW.viMeo

I need to grab it (until he finds a space perhaps). and store it on a already created array.

The need is to separate the vimeo links from the youtube ones and place each of those on the appropriate video object.

I'm not sure if this is possible, I mean, if the URL coming from the browser could be used to be placed on a predefined video object. If it is, then this is the way to go (so I believe).

If all this is feasible, can I have your help in order to build such a rule?

Thanks in advance

© Stack Overflow or respective owner

Related posts about php

Related posts about string