tommr Posted March 7, 2011 Share Posted March 7, 2011 I was getting help with my script and I just noticed this was added. What does it mean? /*** a rfc compliant web address ***/ $url = "http://www.phpro.org"; /*** try to validate the URL ***/ if(filter_var($url, FILTER_VALIDATE_URL) === FALSE) { /*** if there is no match ***/ echo "Sorry, $url is not valid!"; } else { /*** if we match the pattern ***/ echo "The URL, $url is valid!<br />"; } Quote Link to comment https://forums.phpfreaks.com/topic/229895-a-rfc-compliant-web-address/ Share on other sites More sharing options...
HuggieBear Posted March 7, 2011 Share Posted March 7, 2011 It's taking the URL in $url and validating it against a set of rules. Look at filter_var() in the manual. You're filter is FILTER_VALIDATE_URL It's basically checking to make sure that the URL is formed correctly. Quote Link to comment https://forums.phpfreaks.com/topic/229895-a-rfc-compliant-web-address/#findComment-1184263 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.