.Darkman Posted March 28, 2007 Share Posted March 28, 2007 Hello All, How do i check if an input in a text box is a valid URL ? For eg, If the input is, http://something.tld/something it is valid. If it is some thing like rsgsegsx, then it is now valid. How do i find it ? Thanks, Quote Link to comment Share on other sites More sharing options...
trq Posted March 28, 2007 Share Posted March 28, 2007 A simple method would just be to use strpos to check for the existence of http://. A better solution would be to write a regx and use preg_match to execute it against the string. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.