久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放AV片

<center id="vfaef"><input id="vfaef"><table id="vfaef"></table></input></center>

    <p id="vfaef"><kbd id="vfaef"></kbd></p>

    
    
    <pre id="vfaef"><u id="vfaef"></u></pre>

      <thead id="vfaef"><input id="vfaef"></input></thead>

    1. 站長(zhǎng)資訊網(wǎng)
      最全最豐富的資訊網(wǎng)站

      php如何判斷頁(yè)面是否關(guān)閉

      php判斷頁(yè)面是否關(guān)閉的方法:可以利用connection_status()函數(shù)來(lái)進(jìn)行判斷。如果該函數(shù)返回0,則表示連接運(yùn)行正常;如果返回1,則表示連接由用戶或網(wǎng)絡(luò)錯(cuò)誤終止。

      php如何判斷頁(yè)面是否關(guān)閉

      相關(guān)函數(shù)介紹:

      connection_status() 函數(shù)返回當(dāng)前的連接狀態(tài)。

      (推薦教程:php視頻教程)

      可返回的可能值:

      • 0 – CONNECTION_NORMAL – 連接運(yùn)行正常

      • 1 – CONNECTION_ABORTED – 連接由用戶或網(wǎng)絡(luò)錯(cuò)誤終止

      • 2 – CONNECTION_TIMEOUT – 連接超時(shí)

      • 3 – CONNECTION_ABORTED & CONNECTION_TIMEOUT

      代碼實(shí)現(xiàn):

      echo str_repeat(" ",3000); ignore_user_abort(true);  mylog('online'); while (true) {    /*    * 1、程序正常結(jié)束   connection_status 0    * 2、點(diǎn)擊瀏覽器“停止”按鈕   connection_status 1    * 3、超時(shí)  connection_status 2    */  echo "test<br>n"; //注意程序一定要有輸出,否則ABORTED狀態(tài)是檢測(cè)不到的  flush();  sleep(1);  if (connection_status()!=0){     mylog('offline');     die('end the script');  } } function mylog($str) {    $fp = fopen('e:/abort.txt', 'a');    $str = date('Y-m-d H:i:s').$str."rn";    fwrite($fp, $str);    fclose($fp); }

      贊(0)
      分享到: 更多 (0)
      網(wǎng)站地圖   滬ICP備18035694號(hào)-2    滬公網(wǎng)安備31011702889846號(hào)