检测浏览器连接在PHP关闭 [英] Detect browser connection closed in PHP

查看:241
本文介绍了检测浏览器连接在PHP关闭的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有谁知道是否有可能来检测浏览器是否已关闭很长的 PHP 脚本的执行过程中的连接,使用时阿帕奇 mod_php的

Does anyone know if it is possible to detect whether the browser has closed the connection during the execution of a long PHP script, when using apache and mod_php?

例如,在的Java HttpOutputStream 将抛出一个例外如果一个人写它在浏览器关闭后它 - 或将负 checkError()

For example, in Java, the HttpOutputStream will throw an exception if one attempts to write to it after the browser has closed it -- Or will respond negatively to checkError().

推荐答案

使用 connection_aborted()

这篇关于检测浏览器连接在PHP关闭的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆