PHP connection_aborted()Funciones

PHP Misc 参考手册Manual de referencia de PHP Misc

Ejemplo

Cree una función (check_abort()) que escriba un mensaje de registro cuando el cliente termine el 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");
?>


Definición y uso

La función connection_aborted() comprueba si el cliente se ha desconectado.


Sintaxis

connection_aborted()

Detalles técnicos

Valor de retorno: Devuelve 1 si la conexión se ha terminado, de lo contrario devuelve 0.
Versión de PHP: 4+


PHP Misc 参考手册Manual de referencia de PHP Misc Otras extensiones