PHP: How to check whether the URL is Youtube's or vimeo's

后端 未结 8 1788
感情败类
感情败类 2021-02-02 01:19

How can I write a function to check whether the provided URLs is youtube or vimeo?

For instance, I have this two URLs that I store in a database as strings,



        
8条回答
  •  离开以前
    2021-02-02 01:50

    Use regular expressions. What language are you using?

    Edit: noticed your tag was php. It would be something like this:

    
    

提交回复
热议问题