PHP 教程 PHP 表单 PHP 高级教程 PHP 数据库 PHP XML PHP 与 AJAX PHP 参考手册

发布于 2016-11-18 14:36:27 | 67 次阅读 | 评论: 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() 函数返回当前的连接状态。

可返回的可能值:

  • 0 - CONNECTION_NORMAL - 连接运行正常
  • 1 - CONNECTION_ABORTED - 连接由用户或网络错误终止
  • 2 - CONNECTION_TIMEOUT - 连接超时
  • 3 - CONNECTION_ABORTED & CONNECTION_TIMEOUT

语法

 connection_status()

技术细节

返回值:返回连接状态位字段。
PHP 版本:4+


最新网友评论  共有(0)条评论 发布评论 返回顶部

Copyright © 2007-2017 PHPERZ.COM All Rights Reserved   冀ICP备14009818号  版权声明  广告服务