x
 
<!DOCTYPE html>
<html>
<body>
<?php
switch (connection_status())
{
case CONNECTION_NORMAL:
  $txt = '连接状态正常';
  break;
case CONNECTION_ABORTED:
  $txt = '连接已中止';
  break;
case CONNECTION_TIMEOUT:
  $txt = '连接超时';
  break;
case (CONNECTION_ABORTED & CONNECTION_TIMEOUT):
  $txt = '连接中止并超时';
  break;
default:
  $txt = '未知状态';
  break;
}
echo $txt;
?>
</body>
</html>