codeboy89 Posted November 20, 2009 Share Posted November 20, 2009 I need a preg_match that makes sure the input begins with "http://" and contains at least one "." This is what I currently have, if (trim(strip_tags(!preg_match("#^http://www\.[a-z0-9-.]+\.[a-z]{2,4}$#i",$_POST['link'])))) Link to comment https://forums.phpfreaks.com/topic/182234-need-help-with-url-preg_match/ Share on other sites More sharing options...
JAY6390 Posted November 20, 2009 Share Posted November 20, 2009 surely it would be better to use parse_url() Link to comment https://forums.phpfreaks.com/topic/182234-need-help-with-url-preg_match/#findComment-961612 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.