connection_status()

收藏:0   阅读:28

实例

返回连接状态:

<?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+
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!