[英]Way of storing data in the session scope in php and the life cycle
Is there a way of storing variables in a PHP application in the session scope or the application scope...? 有没有一种方法可以在会话范围或应用程序范围内的PHP应用程序中存储变量? At the same time can someone please explain the life cycle of a php program..?
同时有人可以解释php程序的生命周期吗? Thanx...
谢谢...
life cycle of a php program is very short. php程序的生命周期非常短。
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. 这就是为什么您需要会话-保存两次调用之间的变量的原因。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.