小白教程
所有教程
关于
Search
172.70.127.96
172.70.127.96
参数设置
贡献
退出
操作
编辑
移动
保护
信息
历史
删除
查看“Func misc connection status”的源代码
本页内容
上一节:
Func_misc_connection_aborted
下一节:
Func_misc_constant
因为以下原因,您没有权限编辑本页:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
{{DISPLAYTITLE:connection_status()}}[[Category:PHP 杂项函数参考手册|2]] = PHP connection_status() 函数 = [[:Category:PHP 杂项函数参考手册]] 返回连接状态: <sample title="" desc="" lang="php" hererun="1"> <?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; ?> </sample> == 定义和用法 == connection_status() 函数返回当前的连接状态。 可返回的可能值: * 0 - CONNECTION_NORMAL - 连接运行正常 * 1 - CONNECTION_ABORTED - 连接由用户或网络错误终止 * 2 - CONNECTION_TIMEOUT - 连接超时 * 3 - CONNECTION_ABORTED & CONNECTION_TIMEOUT == 语法 == <pre> connection_status()</pre> == 技术细节 == {| class="table table-striped table-hover" | 返回值: | 返回连接状态位字段。 |- | PHP 版本: | 4+ |} [[:Category:PHP 杂项函数参考手册]]
返回至“
Func misc connection status
”。
上一节:
Func_misc_connection_aborted
下一节:
Func_misc_constant