FILTER_VALIDATE_IP
Output is
To check IPV4 address ONLY , we can add optional flag like this
Above validation will fail as we used FILTER_FLAG_IPV4 to check one IPV6 address. Now let us try one IPV4 address.
Output is here
No private range of IP is allowed by using Flag FILTER_FLAG_NO_PRIV_RANGE
Output is
No reserve range of IP address are allowed by using FILTER_FLAG_NO_RES_RANGE
Output is
Subscribe to our YouTube Channel here
This article is written by plus2net.com team.
https://www.plus2net.com
![]() | ||||||||||
filter_list:PHP list of filters available and how to display
filter_has_var: checking the existance of variable in PHP filter_var: Validating variable using filter id FILTER_VALIDATE_FLOAT: Validating Float data FILTER_VALIDATE_INT: Validating Integer with Maximum and Minimum range FILTER_VALIDATE_REGEXP: Validating REgular Expression FILTER_VALIDATE_EMAIL: Validating Email FILTER_VALIDATE_URL: Validating URL with query string and path FILTER_VALIDATE_IP: Validating IPV4 and IPV6 address FILTER_VALIDATE_BOOLEAN: Validating boolean variable FILTER_SANITIZE_STRING: Sanitize string FILTER_SANITIZE_URL: Sanitize url | ||||||||||