PHP connection_aborted() 関数

❮ PHP Misc リファレンス

クライアントがスクリプトを切断した場合に、ログメッセージを書き込む関数(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 Misc リファレンス