/**
* 匹配IP地址
* @param string $subject
* @return bool
*/
function checkVailIp(string $subject){
$pattern = "/(1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|[1-9])\.";
$pattern .="(1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|\d)\.";
$pattern .="(1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|\d)\.";
$pattern .="(1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|\d)/";
if (preg_match($pattern,$subject)){
return true;
}else{
return false;
}
}