PHP connection_aborted () função
Manual do PHP Diversos Referência
Exemplos
Criar uma função (check_abort ()), escreve uma mensagem de log quando o cliente termina o script:
<?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");
?>
Definição e Uso
connection_aborted () função verifica se o cliente está desconectado.
gramática
connection_aborted()
detalhes técnicos
retorna: | Se a conexão é encerrada retorna 1, senão retorna 0. |
---|---|
versão do PHP: | 4+ |
Manual do PHP Diversos Referência