好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

php使用preg_match()函数验证ip地址的方法

    $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;

    }

}

echo fun("255.255.255.255");

查看更多关于php使用preg_match()函数验证ip地址的方法的详细内容...

  阅读:56次