Deprecated: Function ereg() is deprecated in

在php5.3环境下运行,经常会出现php

 Deprecated: Function ereg() is deprecated in...和Deprecated: Function ereg_replace() is deprecated in...这些类型的报错提示。
  其缘由在于:php5.3以上的版本不支持ereg()函数,而是使用preg_match()函数;不支持ereg_replace()函数,而使用preg_replace()函数。
  解决方法:将不支持的函数修改成支持的函数便可。
  
      例如
  if(eregi('^('value', $value)
  改成:
  if(preg_match('/value/', $value)
  
  再例如:
  $string = ereg_replace(' value', ' ', trim($string));
  改成:
  $string = preg_replace('{ value}', ' ', trim($string));
  
解决Deprecated: Assigning the return value of new by reference is deprecated in报错函数

由于咱们如今php是5.3的缘由,在php5.3之中能够直接用”=”,而以前由于在本地上测试都是5.3如下的php环境用的是”=&”符号。测试

在 5.3版本以后已经不容许在程序中使用”=&”符号。若是你的网站出现了Deprecated: Assigning the return value of new by reference is deprecated in 错误,别着急,先定位到出错的文件,查找下是否是在程序中使用了”=&”,发现使用了”=&”符号,去掉‘&’符号以后程序运行 正常。网站

问题:Deprecated: Function set_magic_quotes_runtime() is deprecated in
致使这个提示的缘由是在PHP5.3后此特性(set_magic_quotes_runtime())已经关闭。
并且在PHP6中已经彻底移除此特性。
你能够注释或者删除掉出错的行,或者是在set_magic_quotes_runtime()前面加@符号 .net

相关文章
相关标签/搜索