<?php
//响应头格式为json,编码为uft-8,注意有-
header("Content-Type:application/json;charset=utf-8");
// require_once("00_init.php");
//创建数据库的连接mysqli_connect如果写成mysql_connect()会出现access denied拒绝访问;
$conn=mysqli_connect("127.0.0.1","root","","xz",3306);
//设置编码为utf8,注意这里没有-因为MySQL对这个起名叫utf8,因为在做这个数据库时写错了,因此编码写成utf8
mysqli_query($conn,"SET NAMES UTF8");
//获取用户参数aname和apwd,@可以防止报错
@$aname=$_REQUEST["aname"];
@$apwd=$_REQUEST["apwd"];
$n_reg='/^[a-zo-9A-Z]{3,8}$/';
$n=preg_match($n_reg,$aname);
$p=preg_match($n_reg,$apwd);

报错信息


1 <b>Warning</b>:  preg_match(): Compilation failed: range out of order in character class at offset 7 in 
  <b>C:\xampp\htdocs\h5\admin\data\01_login.php</b> on line <b>13</b><br />
2 <br />
//报错原因是在13行的preg_match()函数中出现编译错误,错误内容是在第7个字符中出现了范围溢出,即正则表达式出错了,12行中的正则表达式中的0-9写成o-9;为啥不会是$aname错误而是正则呢?
//因为字符串的内容是随意的,它只是过来给正则进行匹配,符合返回true,不符合返回false。
 

错误记录PHP preg_match(): Compilation failed: range out of order in character class at offset 7 01_login.php</b> on line <b>13</b><br />的更多相关文章

  1. 开发错误记录3:问题 Error:failed to find Build Tools revision 23.0.2

    今天导入swiperefreshlayoutdemo 问题 Error:failed to find Build Tools revision 23.0.2 修改build.gradle 里面设置,其 ...

  2. preg_match(): Compilation failed: character value in \x{} or \o{} is too large at offset 8

    如果用正则筛选中文的时候,需要在规则后面添加字符u,表示使用utf8编码去解析 $reg = '/[\x{4e00}-\x{9fa5}]/u'; 例如: $reg = '/[\x{4e00}-\x{9 ...

  3. Error:java:Compilation failed: internal java compiler error

    在IDEA中编译时出现这个错误:Error:java:Compilation failed: internal java compiler error! Information:Using javac ...

  4. Compilation failed: internal java compiler error

    在Idea中编译时出现这个错误:Error:java: Compilation failed: internal java compiler error. Information:Using java ...

  5. PHP Warning: preg_match(): JIT compilation failed: no more memory in

    PHP7.3出现如下错误:PHP Warning: preg_match(): JIT compilation failed: no more memory in ... 解决方案: 修改 /usr/ ...

  6. IntelliJ IDEA 运行错误:java: Compilation failed: internal java compiler error

    错误:java: Compilation failed: internal java compiler error 解决的方法: 文件 --> 设置 : 若没有模块,点击右边的把自己项目的模块添 ...

  7. Compilation failed (return status=1): g++.exe: error: CreateProcess: No such file or directory错误

    windows10上 theano安装之后出现的问题 >>> import theano You can find the C code in this temporary file ...

  8. Warning: preg_replace(): Compilation failed: missing terminating ] for character class at offset 10 in

    Warning: preg_replace(): Compilation failed: missing terminating ] for character class at offset 10 ...

  9. android常犯错误记录

    错误:Error:Error: Found item Attr/border_width more than one time 这个容易,属性相同了,按照提示查询一下找出来删了就行了,注意大小写很容易 ...

随机推荐

  1. client-go向controller进发---手动实现

    参考URL: https://www.jianshu.com/p/49f741492874 完全靠手动实现,不用code-generator,kubebuilder或是operator-sdk. 要注 ...

  2. 13.Java基础_数组内存图

    单个数组内存图 new int[3]: 在堆内存里申请一块空间存储int类型的变量(初始化时值都为0) int[] array: 在栈内存申请一块内存存储堆内存里数组的首地址 array[i]: 通过 ...

  3. jmeter beanshell断言接口自动化实例

    一.JMeter介绍 Apache JMeter是一款优秀的开源性能测试工具,在国外无论是在性能测试还是接口测试领域都有着非常高的使用率,但由于本身没有完善的中文文档以及典型开源工具特点(界面不美观) ...

  4. SpringCloud学习笔记(九、SpringCloud Stream)

    目录: 什么是SpringCloud Stream 如何使用SpringCloud Stream 消息分流 什么是SpringCloud Stream: SpringCloud Stream是一个用于 ...

  5. SpringCloud学习笔记(四、SpringCloud Netflix Ribbon)

    目录: Ribbon简介 Ribbon的应用 RestTemplate简介 Ribbon负载均衡源码分析 Ribbon简介: 1.负载均衡是什么 负载均衡,根据其字面意思来说就是让集群服务具有共同完成 ...

  6. [C4] Andrew Ng - Improving Deep Neural Networks: Hyperparameter tuning, Regularization and Optimization

    About this Course This course will teach you the "magic" of getting deep learning to work ...

  7. Java进阶的道路,怎么成为大牛?

    已然励志在java路上走的更远,那就有必要了解java的途径.先看图 image.png 愈加细化的细节如下​ 一: 编程基础 不管是C仍是C++,不管是Java仍是PHP,想成为一名合格的程序员,根 ...

  8. h5 ios移动端,键盘收起以后页面不归位

    $('input,textarea').on('blur',function(){ window.scroll(0,0); }); $('select').on('change',function() ...

  9. Spring框架spring-web模块中的RestTemplate类详解

    RestTemplate类是spring-web模块中进行HTTP访问的REST客户端核心类.RestTemplate请求使用阻塞式IO,适合低并发的应用场景. 1. RestTemplate类提供了 ...

  10. Linux高性能服务器编程,书中的 shell 命令

    记录<Linux高性能服务器编程>书里面讲解到的若干 shell 命令 arp 命令查看ARP高速缓存: [root@VM_0_10_centos heliang]# arp -a ? ( ...