fonction connection_status PHP ()
Exemples
Renvoie l'état de la connexion:
<?php
switch (connection_status())
{
case CONNECTION_NORMAL:
$txt = 'Connection is in a normal state';
break;
case CONNECTION_ABORTED:
$txt = 'Connection aborted';
break;
case CONNECTION_TIMEOUT:
$txt = 'Connection timed out';
break;
case (CONNECTION_ABORTED & CONNECTION_TIMEOUT):
$txt = 'Connection aborted and timed out';
break;
default:
$txt = 'Unknown';
break;
}
echo $txt;
?>
switch (connection_status())
{
case CONNECTION_NORMAL:
$txt = 'Connection is in a normal state';
break;
case CONNECTION_ABORTED:
$txt = 'Connection aborted';
break;
case CONNECTION_TIMEOUT:
$txt = 'Connection timed out';
break;
case (CONNECTION_ABORTED & CONNECTION_TIMEOUT):
$txt = 'Connection aborted and timed out';
break;
default:
$txt = 'Unknown';
break;
}
echo $txt;
?>
Exécution instance »
Définition et utilisation
fonction connection_status () renvoie l'état actuel de la connexion.
Les valeurs possibles peuvent être retournées:
- 0 - CONNECTION_NORMAL - connecté à un fonctionnement
- 1 - CONNECTION_ABORTED - erreur de connexion terminée par l'utilisateur ou le réseau
- 2 - CONNECTION_TIMEOUT - Délai de connexion
- 3 - CONNECTION_ABORTED & CONNECTION_TIMEOUT
grammaire
connection_status()
détails techniques
Retours: | Renvoie le champ de bits d'état de connexion. |
---|---|
PHP version: | 4+ |
Manuel PHP Divers Référence