PHP connection_status() 関数

❮ PHP Misc リファレンス

接続ステータスを返します:

<?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;
?>
例の実行 »

定義と用法

connection_status() 関数は、現在の接続ステータスを返します。

返される可能性のある値は、次の通りです:


構文

connection_status()

技術内容
返り値: 接続ステータスのビットフィールドを返します
PHP バージョン: 4+

❮ PHP Misc リファレンス