//判断正整数 $str = '/^\+?[1-9][0-9]*$/'; //判断整数 $str = '/^-?[1-9]\d*$/'; preg_match($str,被验证字符串) 返回匹配次数0或者1次,匹配到一次即刻返回