/**
* 检测是否为IP
* @param [type] $ip [description]
* @return [type] [description]
*/
function funip($ip){
//IP正则匹配
//0.0.0.0--- 255.255.255.255
$pat = "/^(((1?\d{1,2})|(2[0-4]\d)|(25[0-5]))\.){3}((1?\d{1,2})|(2[0-4]\d)|(25[0-5]))$/";
if(preg_match($pat,$ip)){
$num = preg_match($pat,$ip);
return $num;
}else{
$num = preg_match($pat,$ip);
return $num;
}
}
如果文章或资源对您有帮助,欢迎打赏作者。一路走来,感谢有您!
txttool.com 说一段 esp56物联 查询128 IP查询