DevShed continues their validation series today with this new tutorial, a look at validating URLs, host and paths with the filter extension bundled with PHP.
Validation process performed on URLs [in the previous part of the series] was pretty simplistic. Thus, in this sixth episode of the series I'm going to dig deeper into the usage of the FILTER_VALIDATE_URL filter to show you how to validate different portions of a URL, including its protocol, host and eventual paths.
They enforce the filtering by adding in the FILTER_FLAG_SCHEME_REQUIRED or FILTER_FLAG_HOST_REQUIRED flags to the filters to ensure the information is valid too (not just in the right format).