php中session范围内数据的存储方式及生命周期
有没有办法将变量存储在会话范围或应用程序范围的 PHP 应用程序中?同时有人可以解释一下 php 程序的生命周期吗? 谢谢...
Is there a way of storing variables in a PHP application in the session scope or the application scope...? At the same time can someone please explain the life cycle of a php program..?
Thanx...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
php程序的生命周期很短。
它不像一个桌面应用程序在您的浏览器中不断运行,甚至不像一个与您的桌面应用程序持续连接的恶魔。它更像是一个命令行实用程序 - 完成它的工作并退出。它独立运行:
这就是您需要会话的原因 - 保存调用之间的变量。
life cycle of a php program is very short.
It's not like a desktop application constantly running in your browser, and not even a demon with persistent connection to your desktop application. It's more like a command line utility - doing it's job and exits. It runs discrete:
That's why you need sessions - to save the variables between calls.