PHP connection_status() ကုသိုလ်

အမှတ်အသေး

connection_status() ကုသိုလ် သည် လက်ရှိ ဆက်သွယ်မှု အခြေအနေ ပြန်လည်ပေးသည်

အခါ နိုင်သော အရေးယူ

  • 0 - CONNECTION_NORMAL - ဆက်သွယ်မှု သားကြီး
  • 1 - CONNECTION_ABORTED - ဆက်သွယ်မှု အသုံးပြုသူ သို့မဟုတ် နည်းပါးခြင်း ဖြင့် ဖြတ်သန်း
  • 2 - CONNECTION_TIMEOUT - ဆက်သွယ်မှု ဖြတ်သန်း
  • 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;
?>