PHP connection_aborted () fonction
Exemples
Créer une fonction (check_abort ()), écrit un message de journal lorsque le client se termine le 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");
?>
Définition et utilisation
connection_aborted () vérifie si le client est déconnecté.
grammaire
connection_aborted()
détails techniques
Retours: | Si la connexion est interrompue retourne 1, sinon elle retourne 0. |
---|---|
PHP version: | 4+ |
Manuel PHP Divers Référence