HomeMenu
Jesus · Bible · HTML · CSS · JS · PHP · SVG · Applications

connection_status

Description

The connection_status of Miscellaneous for PHP returns connection status bitfield.

Syntax

connection_status(): int

Return

Returns the connection status bitfield, which can be used against the CONNECTION_XXX constants to determine the connection status.

Examples

1 · void

<?

$return = connection_status();

echo $return;
0

2

<?

$return = connection_status();

switch($return)
{
    case CONNECTION_NORMAL:
        echo "normal";
        break;
    case CONNECTION_ABORTED:
        echo "aborted";
        break;
    case CONNECTION_TIMEOUT:
        echo "timeout";
        break;
}
normal