Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想在内容保存在变量中后 5 分钟内将 SESSION 变量的内容保存在数据库中。我怎样才能做到这一点 ?有没有办法避免 cron ?
您可以将数据保存在带有时间戳的表/文件/任何内容中-但正如您所说,您需要对其进行 cron 或其他等效操作-无法在网页上执行操作,然后使用会话执行某些操作5分钟后的数据。
除非他们留在页面上并执行 AJAX 请求或类似的事情。