过滤器验证ip地址,是否合法。
定义和用法
该过滤器验证FILTER_VALIDATE_IP价值作为一个网址。
名称: “ validate_ip ”
身份证号码: 275
可能的旗帜:
<?php $ip = "192.168.0.1";
if(!filter_var($ip, FILTER_VALIDATE_IP))
{
echo "IP is not valid";
}
else
{
echo "IP is valid";
}
?>
输出结果。
is is valid
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn