PHP connection_aborted() 函数

PHP 教程 · 2019-01-27 11:12:47

实例

创建一个函数(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+

点击查看所有 PHP 教程 文章: https://codercto.com/courses/l/5.html

查看所有标签

The Haskell School of Expression

The Haskell School of Expression

Paul Hudak / Cambridge University Press / 2000-01 / USD 95.00

Functional programming is a style of programming that emphasizes the use of functions (in contrast to object-oriented programming, which emphasizes the use of objects). It has become popular in recen......一起来看看 《The Haskell School of Expression》 这本书的介绍吧!

html转js在线工具
html转js在线工具

html转js在线工具

UNIX 时间戳转换
UNIX 时间戳转换

UNIX 时间戳转换