本文实例讲述了php保存信息到当前Session的方法。分享给大家供大家参考。具体如下:

php中可通过$_SESSION保存session变量,下面的代码简单演示了 $_SESSION的用法

<"<html><b>");
 $_SESSION["sitename"] = "W3M";
 print("A value saved in the session named as sitename.\n");
 $_SESSION["MyChoice"] = "red";
 print("A value saved in the session named as MyChoice.\n");
 echo $_SESSION['sitename']."\n";
 echo $_SESSION['MyChoice]."\n";
 print("</b></html>\n");
"htmlcode">
A value saved in the session named as MyLogin.
A value saved in the session named as MyColor.
W3M
red

希望本文所述对大家的php程序设计有所帮助。

风云阁资源网 Design By www.bgabc.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
风云阁资源网 Design By www.bgabc.com