PHP connection_status() fonksiyonu
Tanım ve Kullanım
connection_status() fonksiyonu mevcut bağlantı durumunu döndürür.
Dönüştürülebilir olası değerler:
- 0 - CONNECTION_NORMAL - Bağlantı normal bir durumda çalışıyor
- 1 - CONNECTION_ABORTED - Bağlantı kullanıcı veya ağ hatası tarafından sonlandırıldı
- 2 - CONNECTION_TIMEOUT - Bağlantı zaman aşımı
- 3 - CONNECTION_ABORTED & CONNECTION_TIMEOUT
Gramer
connection_status()
Örnek
<?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; ?>