您现在的位置是:首页 > PHP函数

李清波 2021-06-17 PHP函数 1410 复制当前网址

connection_aborted



PHP connection_aborted() 函数

定义和用法

connection_aborted() 函数检查是否断开客户机。

如果已终止连接,则该函返回 1,否则返回 0。


语法

connection_aborted()


例子

创建一个函数,在客户机终止脚本时写入一条日志消息:

<?php
function check_abort()
  {
  if (connection_aborted())
  error_log ("Script $GLOBALS[SCRIPT_NAME]" .
  "$GLOBALS[SERVER_NAME] was aborted by the user.");
  }//要执行的一些代码// 在脚本结束时调用 check_abort 函数register_shutdown_function("check_abort");
?>


文章来源:https://www.liqingbo.com/blog-924.html

上一篇:connection_status

下一篇:zip_read

评论