返回連線狀態:
<?phpswitch (connection_status()){case CONNECTION_NORMAL: $txt = 'Connection is in a normal state'; break;case CONNECTION_ABORTED: $txt = 'Connection aborted'; break;case CONNECTION_TIMEOUT: $ ; 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+ |