PHP connection_status() Funksie
Voorbeeld
Gee die verbinding satus terug:
<?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;
?>
Definisie en gebruik
Die verbinding_status()-funksie gee die huidige verbindingstatus terug.
Moontlike waardes wat teruggestuur kan word, is:
- 0 - CONNECTION_NORMAL - verbinding loop normaalweg
- 1 - CONNECTION_ABORTED - verbinding is afgebreek deur gebruiker- of netwerkfout
- 2 - CONNECTION_TIMEOUT - verbinding het uitgetel
- 3 - CONNECTION_ABORTED & CONNECTION_TIMEOUT
Sintaksis
connection_status()
Tegniese besonderhede
Terugkeerwaarde: | Wys die verbindingstatus-bitveld |
---|---|
PHP weergawe: | 4+ |
❮ PHP Misc Reference