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");
?>
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 リファレンスマニュアル その他の拡張