发布于 2016-11-18 14:36:27 | 70 次阅读 | 评论: 0 | 来源: 网络整理
返回连接状态:
<?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+ |