função PHP connection_status ()
Manual do PHP Diversos Referência
Exemplos
Retorna o status da conexão:
<?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;
?>
Correndo instância »
Definição e Uso
função connection_status () retorna o status da conexão atual.
Os valores possíveis pode ser devolvido:
- 0 - CONNECTION_NORMAL - ligado a um funcionamento
- 1 - connection_aborted - erro de conexão encerrada pelo usuário ou a rede
- 2 - connection_timeout - tempo limite de conexão
- 3 - connection_aborted & connection_timeout
gramática
connection_status()
detalhes técnicos
retorna: | Retorna o campo de bits status da conexão. |
---|---|
versão do PHP: | 4+ |
Manual do PHP Diversos Referência