PHP connection_status() Functie
Voorbeeld
Retourneer de verbindingsstatus:
<?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;
?>
Definitie en gebruik
De functie connection_status() retourneert de huidige verbindingsstatus.
Mogelijke waarden die kunnen worden geretourneerd zijn:
- 0 - CONNECTION_NORMAL - verbinding werkt normaal
- 1 - CONNECTION_ABORTED - verbinding is afgebroken door gebruikers- of netwerkfout
- 2 - CONNECTION_TIMEOUT - time-out verbinding
- 3 - CONNECTION_ABORTED & CONNECTION_TIMEOUT
Syntaxis
connection_status()
Technische details
Winstwaarde: | Retourneert het bitveld van de verbindingsstatus |
---|---|
PHP-versie: | 4+ |
❮ PHP overige referentie