Location: Utah, USA, Northwestern hemisphere, Earth, Solar System, Milky Way Galaxy, Alpha Quadrant
Posts: 7,686
Thanks: 42
Thanked 637 Times in 625 Posts
You're basically asking what is the regex to identify a URL, which has been covered at least a thousand times before. Google "php url regex" and I'm sure you'll find a regex to use. You can also search Coding Forums, as I've seen it discussed a number of times in the past.