久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放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. 站長資訊網(wǎng)
      最全最豐富的資訊網(wǎng)站

      如何解決php網(wǎng)頁抓取亂碼問題

      php網(wǎng)頁抓取亂碼的解決辦法:1、使用“mbconvertencoding”轉(zhuǎn)換編碼;2、設置添加“curl_setopt($ch, CURLOPT_ENCODING, 'gzip');”選項;3、在頂部增加header代碼。

      如何解決php網(wǎng)頁抓取亂碼問題

      推薦:《PHP視頻教程》

      php 抓取頁面亂碼

      在抓取頁面的時候出現(xiàn)類似???????這樣亂碼解決方法如下

      1、轉(zhuǎn)換編碼

      str=mbconvertencoding(str, “utf-8”, “GBK”);

      2、數(shù)據(jù)經(jīng)過gzip壓縮

      curl獲取數(shù)據(jù)的時候設置添加下面的選項:

      curl_setopt($ch, CURLOPT_ENCODING, 'gzip');

      使用file_get_contents函數(shù)需要安裝zlib庫

      $data = file_get_contents("compress.zlib://".$url);

      3、獲取數(shù)據(jù)后顯示亂碼

      在頂部增加下面的代碼

      header("Content-type: text/html; charset=utf-8");

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