返回连接状态:
<?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+ |
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!