本地测试的程序上传到服务器出现很多错误,Deprecated: Function split() is deprecated  
查了原因是因为PHP的版本不同所导致的,本身程序开发的时候用的是PHP5.2以下版本,而现在空间上用的是PHP5.3的版本,很多PHP函数已经过时不能用了,这里的这个错误原因就是函数split()在 PHP5.3 中已经不建议使用了。

PHP5.3 split() 不建议使用的原因:
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

PHP split() 替代方案
* 需要regex 的split, 可用preg_split() 代替
* 不需要regex, 只要要快速分割固定的字串, 可用explode() 代替. (速度会比需要regex 的快很多)

Deprecated: Function split() is deprecated in ... 解决办法的更多相关文章

  1. PHP:错误 Deprecated: Function split() is deprecated in ... 解决办法

    PHP:错误 Deprecated: Function split() is deprecated in ... 解决办法 PHP5.3 split() 不建议使用的原因:PHP 5.3.0 之后的r ...

  2. PHP Deprecated: Function split() is deprecated in /var/www/html/cacti/cmd.php on line 61

    [root@localhost cacti]# php cmd.php PHP Deprecated: Function split() is deprecated in /var/www/html/ ...

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

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

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

    在 php5.3环境下运行oscommerce,常常会出现Deprecated: Function ereg() is deprecated in...和Deprecated: Function er ...

  5. ecshop报错”Deprecated: Assigning the return value of…”解决办法

    ECSHOP生成站点地图提示”Deprecated: Assigning the return value of new by reference is deprecated in…”. 我的问题在批 ...

  6. PHP报错Deprecated: Function ereg_replace() is deprecated in

    可能用了PHP5.3乃至更高的PHP版本,目前DEDE中有很多地方的正则函数都用的ereg_replace,而这个函数现在在PHP5.3中已经被废止了. 解决办法: 如果一定要用php5.3,请修改p ...

  7. 【转】Deprecated: Function ereg_replace() is deprecated的解决方法

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

  8. php 版本升高后 会出现 之Deprecated: Function ereg_replace() is deprecated的解决方法

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

  9. php5.3不支持 ereg、ereg_replace等函数问题,如提示:Deprecated: Function ereg() is deprecated

    在php5.3中,正则函数ereg_replace已经废弃,而dedecms还继续用.有两个方案可以解决以上问题: 1.把php版本换到v5.3下. 2.继续使用v5.3,修改php.ini文件 ;e ...

随机推荐

  1. 0525 Scrum 项目7.0

    一.sprint总结 本次sprint总结,本次合作每个人都完成了属于自己的任务,我觉得这是十分不错的,但是做出来的项目不够美观,内容可以更丰富一点,多样化一点,虽然每个人做出来的网页都各有各的区别, ...

  2. javascript百度地图添加一个普通标注点(2014-3-8 记)

    1.导入jquery.js文件:<script type="text/javascript" src="js/jquery.js"></scr ...

  3. js页面刷新之实现框架内外刷新(整体、局部)

    这次总结的是框架刷新: 框架内外的按钮均可以定义网页重定向, 框架内部页面的按钮可以实现局部刷新, 框架外部页面的按钮可以实现整页刷新. 代码如下(两个html页面): <!--主界面index ...

  4. ajax (返回类型:text)

    <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8&quo ...

  5. MariaDB链接超时优化

    查看mysql server超时时间: MariaDB [(none)]> use xspeeder; MariaDB [xspeeder]> show global variables ...

  6. Cenos(6.6/7.1)下从源码安装Python+Django+uwsgi+nginx到写nginx的环境部署(一)

    梳理下这几个的关系: centos是redhat的社区版操作系统. Python2.7.5是开发语言(centos6.5下自带的python是2.6.6版本,所以需要源码更新,而centos7.1下面 ...

  7. manacher浅析

    manacher算法的输入是一个字符串,可以计算出以每个字符为中心的最长回文子串的半径.为了避免讨论奇数偶数,将原串的每两个字母之间以及前后各加一个特殊字母,比如'#',那么对于abcbb就变成了 # ...

  8. Codeforces Round #356 (Div. 2)

    A. Bear and Five Cards time limit per test 2 seconds memory limit per test 256 megabytes input stand ...

  9. powerdesinger中建立一个表后,出现Existence of index的警告

    可以不检查 Existence of index 这项,也就没有这个警告错误了!意思是说没有给表建立索引,而一个表一般至少要有一个索引,这是一个警告,不用的话对执行没有影响~ 转载:http://bl ...

  10. sql语句中left join、inner join中的on与where的区别

    table a(id, type): id     type ---------------------------------- 1      1 2      1 3      2 table b ...