欧卡2中文社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

需要三步,才能开始

只需两步,慢速开始

玩欧卡就用莱仕达V99方向盘欧卡2入门方向盘选莱仕达V9莱仕达折叠便携游戏方向盘支架欢迎地图Mod入驻
查看: 4196|回复: 0
收起左侧

session在php5.3中的变化

[复制链接]
知行 发表于 2012-9-13 13:32 | 显示全部楼层 |阅读模式
在php5.3中运行书中代码会有如下提示:
Function session_is_registered() is deprecated in
Function session_register() is deprecated in

意思是说这两个函数是不赞成的,弃用的。
<?php
// Use of session_register() is deprecated 不赞成用session_register()
$barney = "A big purple dinosaur.";
session_register("barney");

// Use of $_SESSION is preferred, as of PHP 4.1.0 首选 $_SESSION
$_SESSION["zim"] = "An invader from another planet.";

// The old way was to use $HTTP_SESSION_VARS
$HTTP_SESSION_VARS["spongebob"] = "He's got square pants.";
?>
Warning
This function has been DEPRECATED as of PHP 5.3.0 and REMOVED as of PHP 5.4.0.
警告:这个函数在php5.3中已不推荐使用,在php5.4中已被移除。


Note:
If $_SESSION (or $HTTP_SESSION_VARS for PHP 4.0.6 or less) is used, use isset() to check a variable is registered in $_SESSION.
提示:如果 使用了$_SESSION,就用isset()函数来检查。

Caution
If you are using $_SESSION (or $HTTP_SESSION_VARS), do not use session_register(), session_is_registered() and session_unregister().

联系我们|手机版|欧卡2中国 ( 湘ICP备11020288号-1 )

GMT+8, 2024-11-25 12:26 , Processed in 0.054803 second(s), 8 queries , Redis On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表