connection_status() 函數返回當前的(de)連接狀态。
可(kě)返回的(de)可(kě)能值:
0 - CONNECTION_NORMAL - 連接運行正常
1 - CONNECTION_ABORTED - 連接由用(yòng)戶或網絡錯誤終止
2 - CONNECTION_TIMEOUT - 連接超時(shí)
3 - CONNECTION_ABORTED & CONNECTION_TIMEOUT
語法
connection_status()
例子
<?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;
?>
内容源于網絡,如有侵權或違規我們會盡快(kuài)整改