Php/func misc connection aborted
来自菜鸟教程
PHP connection_aborted()函数
例
创建一个函数(check_abort()),如果客户端中止脚本,该函数将写入日志消息:
<?php
function check_abort()
{
if (connection_aborted())
error_log ("Script $GLOBALS[SCRIPT_NAME]" .
"$GLOBALS[SERVER_NAME] was aborted by the user.");
}
// Some script to be executed here
// Call the check_abort function when the script ends
register_shutdown_function("check_abort");
?>
定义和用法
connection_aborted()函数检查客户端是否已断开连接。
句法
connection_aborted()
技术细节
| 返回值: | 如果连接已中止,则返回1,否则返回0 |
| PHP版本: | 4+ |