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 기타 참조 설명서