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,
Use regular expressions. What language are you using?
Edit: noticed your tag was php. It would be something like this: