.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, Link to comment https://forums.phpfreaks.com/topic/44631-validating-an-url/ 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. Link to comment https://forums.phpfreaks.com/topic/44631-validating-an-url/#findComment-216732 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.