Detect browser connection closed in PHP

后端 未结 3 690
迷失自我
迷失自我 2021-01-12 12:11

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

3条回答
  •  温柔的废话
    2021-01-12 12:46

    http://nz.php.net/register-shutdown-function

    Probably less complicated if you just want a script to die and handle it when a user terminates.

    ( Ie: if it was a lengthy search, this would save you a bunch of operation cycles )

提交回复
热议问题