JAVA、PHP、前端、APP、网站开发 - 开发技术学习

开发技术学习 » 编程开发 » Function ereg_replace()、session_is_registered()is deprecated错误解决方法

Function ereg_replace()、session_is_registered()is deprecated错误解决方法

由于现在本地用的php5.3几的版本,别人发过来的源码好多提示。
session_is_registered()函数在PHP4.6以后的版本中好像已经淘汰了,判断是否存在用isset()函数:
if(!isset($_SESSION["username"])){
        header("location:index.php?login=log");
}
在php5.3中官方废弃了很多函数,其中目前本人收集到的有 ereg(); eregi(); ereg_replace(); eregi_replace(); set_magic_quotes_runtime(); split(); mysql_close(); Function ereg_replace()解决办法 1.使用php5.2版本 2.如果一定要用php5.3,请修改php.ini中下面代码 ;extension=php_mbstring.dll 修改为;  extension=php_mbstring.dll ;mbstring.func_overload = 0 修改为; mbstring.func_overload = 7
 

错误 undefined function session_unregister()

打开cacti页面时发现以下错误 Fatal error: Call to undefined function session_unregister() in /usr/local/apache2/htdocs/cacti/lib/functions.php on line 408 解决: vi /usr/local/apache2/htdocs/cacti/lib/functions.php 将 session_unregister($var_name); 改为: unset($_session_unregister[$var_name]); 再重启apache 

站点声明:部分内容源自互联网,为传播信息之用,如有侵权,请联系我们删除。

© Copyright 2011-2024 www.kfju.com. All Rights Reserved.
超级字帖 版权所有。蜀ICP备12031064号