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その他リファレンスマニュアル