php5.3开始出现的Function ereg() is deprecated Error问题解决办法
来源:互联网 发布:js数据是否为json格式 编辑:程序博客网 时间:2024/06/10 18:44
PHP 5.3 ereg() 无法正常使用,提示“Function ereg() is deprecated Error”。问题根源是php中有两种正则表示方法,一个是posix,一个是perl,php6打算废除posix的正则表示方法所以后来就加了个preg_match。此问题解决办法很简单,在ereg前加个过滤提示信息符号即可:把ereg()变成@ereg()。这样屏蔽了提示信息,但根本问题还是没有解决,php在5.2版本以前ereg都使用正常,在5.3以后,就要用preg_match来代替ereg。所以就需要变成这样,原来:
ereg("^[0-9]*$",$page)
变成:
preg_match("/^[0-9]*$/",$page)
特别提醒:posix与perl的很明显的表达区别就是是否加斜杠,所以与ereg相比,后者在正则的前后分别增加了两个”/”符号,不能缺少。
- php5.3开始出现的Function ereg() is deprecated Error问题解决办法
- php5.3开始出现的Function ereg() is deprecated Error问题解决办法
- php5.3开始出现的Function ereg() is deprecated Error问题解决办法
- php5.3开始出现的Function ereg() is deprecated Error问题解决办法
- Function ereg() is deprecated Error
- Function ereg() is deprecated
- Function ereg() is deprecated in
- Deprecated: Function ereg() is deprecated in
- Deprecated: Function ereg() is deprecated in
- Deprecated: Function ereg() is deprecated in 解决方案
- Deprecated: Function ereg() is deprecated in 解决方案
- Deprecated: Function ereg() is deprecated in
- 【php】Deprecated: Function ereg() is deprecated in
- php 5.2以上的ereg Deprecated: Function ereg() is deprecated in 使用pregmatch 正则解决的
- PHP 5.3 ereg() 无法正常使用,提示“Function ereg() is deprecated Error
- Deprecated: Function eregi_replace() is deprecated split() ereg_replace() ereg() eregi() sql_regcas
- Deprecated: Function ereg() is deprecated in 错误提示
- Drupal 6.1.0 Deprecated: Function ereg() is deprecated in xxx includes/file.inc on line 902?
- sql server 表索引优化
- oracle 10g中对已有的表 进行 增 、删 、改 列名
- Jquery弹出层插件Thickbox使用心得
- intel 招聘需求
- Struts1.x 实现文件上传
- php5.3开始出现的Function ereg() is deprecated Error问题解决办法
- Deprecated: Function session_register() is deprecated
- 学习 javascript
- 最近ios开发中用到的一些技术
- ASP.NET&C#学习笔录1(留言功能)
- 外部java库到android framework
- 整数划分
- Linux常用C函数—字符串转换
- LaTeX中文排版(使用XeTeX)