【PHP问题解决办法】Deprecated: Function eregi() is deprecated in

在php升级到php5.3之后后,在使用的过程经常发现有的程序会出现Function eregi() is deprecated 的报错信息。是什么原因呢?
这是因为php5.3中不再支持eregi()函数,而使用preg_match()函数替代。
解决的方法是:将eregi()函数替换成preg_match() 函数。
 if(eregi('^test',$file))
可以替换为
if(preg_match('/^test/i',$file))

————-
PHP 5.3.0 之後的 regex, 希望使用 PCRE 的規格, POSIX Regex 都不建議使用了(統一 Regex, 避免規格太多?).
所以下述是不建議使用的 Function (POSIX), 與建議替換成的 Function (PCRE) 列表, 詳可見: PHP:
Differences from POSIX regex
* POSIX → PCRE
* ereg_replace() → preg_replace()
* ereg() → preg_match()
* eregi_replace() → preg_replace()
* eregi() → preg_match()
* split() → preg_split()
* spliti() → preg_split()
* sql_regcase() → No equivalent
* 需要 regex 的 split, 可用 preg_split() 代替
* 不需要 regex, 只要要快速分割固定的字串, 可用 explode() 代替. (速度會比需要 regex 的快很多)

【PHP问题解决办法】preg_match(): Delimiter must not be alphanumeric or backslash in:https://blog.csdn.net/q906270629/article/details/114922393

【PHP问题解决办法】Deprecated: Function eregi() is deprecated in相关推荐

  1. Deprecated:function eregi() is deprecated in /usr/local/apache/libraries/lib_lang.php on line 8

    Deprecated:function eregi() is deprecated in /usr/local/apache/libraries/lib_lang.php on line 8 Depr ...

  2. Function eregi() is deprecated

    在php升级到php5.3之后后,在使用的过程经常发现有的程序会出现Function eregi() is deprecated 的报错信息.是什么原因呢? 这是因为php5.3中不再支持eregi( ...

  3. Deprecated: Function ereg_replace() is deprecated

    Deprecated: Function ereg_replace() is deprecated in /usr/local/apache/htdocs/cacti/include/global.p ...

  4. 出现Deprecated: Function ereg_replace() is deprecated in 的原因及解决方法

    出现Deprecated: Function ereg_replace() is deprecated in 的原因及解决方法 参考文章: (1)出现Deprecated: Function ereg ...

  5. PHP Deprecated: Function ereg_replace() is deprecated in 的解决方法

    这个问题是因为你用的php版本过高,在php5.3中,正则函数ereg_replace已经废弃,而dedecms还继续用,有两个方案可以解决以上问题: 1.把php版本换到v5.3下. 2.继续使用v ...

  6. PHP问题 —— Deprecated: Function ereg_replace() is de

    1.1  Deprecated: Function ereg_replace() is deprecated 1.1.1  现象 运行应用出现如下错误提示: Deprecated: Function ...

  7. 织梦安装后提示Function ereg_replace() is deprecated的解决方法

    织梦 dedecms v5.6 安装后提示 Deprecated: Function ereg_replace() is deprecated in D:\www\dede\config.php on ...

  8. php7帝国CMS报错Deprecated: Function get_magic_quotes_gpc()

    在对帝国CMS进行升级之后,会出现类似的错误,如下代码所示: Deprecated: Function get_magic_quotes_gpc() is deprecated in /www/www ...

  9. php5.3开始出现的Function ereg() is deprecated Error问题解决办法

    PHP 5.3 ereg() 无法正常使用,提示"Function ereg() is deprecated Error".问题根源是php中有两种正则表示方法,一个是posix, ...

  10. php Function split() is deprecated 的解决办法

    原文地址: http://www.cnblogs.com/mfryf/archive/2012/05/31/2527307.html php升级为5.3后,程序会报 Function split() ...

最新文章

  1. 日志处理模块----logging
  2. MemoryMappingFile泄漏分析过程
  3. kibana操作elasticsearch:修改数据
  4. why SAP CRM My Opportunity Master page must be renamed as S2
  5. Redis 通配符查找及批量删除key
  6. webserver技术总结之一:webserver概念
  7. Mathematic Paradigm
  8. Spreadjs表格
  9. C语言的输出对齐应用
  10. 二阶系统阶跃响应实验__ 二阶系统的阶跃响应实验报告
  11. GOT10K toolkit的使用(python)
  12. html5考试简答题
  13. MPC5744P-UART(LIN)模块
  14. 于的繁体字有几种写法_于字的意思、于的繁体字、于的笔顺笔画、于字部首和繁体字于的意思...
  15. python,你也和小猪佩奇一样社会了!
  16. UE4/5 EasyFog插件使用
  17. springboot整合autopoi-web文件导出Excel,使用注解配置一多
  18. STC 下载 自动波特率 设计
  19. 计算机多媒体培训心得体会,学习计算机多媒体技术心得体会
  20. ENC28J60网络设备驱动分析

热门文章

  1. 小伙深夜加班骑车逆行了,被拦了,爆发了,下跪了,大哭了,压力真的好大!
  2. 太阳方位角/天顶角名词解释及计算方法
  3. ps如何制作霓虹字体
  4. 智能家居平台软件测试,智能家居系统测试
  5. 使用树莓派开启HomeKit智能家居系统 篇一:树莓派系统安装与配置
  6. NPOI实现Word表格删除一行
  7. matlab演示波粒二象性,MATLAB实验电子波动性的Matlab仿真
  8. “区块链+”教育的发展现状及其应用价值研究
  9. 2018.10.29-dtoj-4007-飞天鼠小E
  10. Windows - 强力删除文件