久久青草费线频观看,国产精品久久久久久亚洲AV,被多人玩弄的烂货苏妖精学生,国产九九在线观看播放

互聯(lián)網(wǎng)品牌整合服務(wù)·為夢想者創(chuàng)造夢想品牌

服務(wù)1000+企業(yè),專注企業(yè)網(wǎng)站設(shè)計 / 網(wǎng)站制作 / 網(wǎng)站優(yōu)化推廣 網(wǎng)站托管服務(wù)

了解詳情

致力于服務(wù)頭部企業(yè).打造標(biāo)桿項目

讓每一個作品融入我們的洞察力,創(chuàng)造并呈現(xiàn)精彩 展現(xiàn)您的非凡與不同

了解詳情

網(wǎng)站優(yōu)化 網(wǎng)站搜索排名

濰坊及全國各地區(qū)提供搜索引擎優(yōu)化服務(wù)

了解詳情

做網(wǎng)站過程如何移除BOM 

發(fā)布時間:2016/8/16 9:11:16 關(guān)注:1469


給客戶做網(wǎng)站的過程中發(fā)現(xiàn)頁面頂部總有一個空白區(qū)域,使用chrome檢查發(fā)現(xiàn),添加了&#65279 bom文件頭代碼,按照網(wǎng)上的說法,使用程序編輯軟件就能移除,使用DW看到已經(jīng)顯示移除,可奇怪的是一只存在,在網(wǎng)上搜索的過程中發(fā)現(xiàn)以下代碼可以一次全部檢測程序代碼中的bom,同時可以移除,希望有幫助到同樣迷惑的朋友們。
<?php
//remove the utf-8 boms
//by magicbug at gmail dot com
if (isset($_GET['dir'])){ //config the basedir
 $basedir=$_GET['dir'];
}else{
 $basedir = '.';
} 
$auto = 1; 
checkdir($basedir);
function checkdir($basedir){
 if ($dh = opendir($basedir)) {
  while (($file = readdir($dh)) !== false) {
   if ($file != '.' && $file != '..'){
    if (!is_dir($basedir."/".$file)) {
     echo "filename: $basedir/
$file ".checkBOM("$basedir/$file")." <br>";
    }else{
     $dirname = $basedir."/".
$file;
     checkdir($dirname);
    }
   }
  }
 closedir($dh);
 }
}

function checkBOM ($filename) {
 global $auto;
 $contents = file_get_contents($filename);
 $charset[1] = substr($contents, 0, 1);
 $charset[2] = substr($contents, 1, 1);
 $charset[3] = substr($contents, 2, 1);
 if (ord($charset[1]) == 239 && ord($charset[2]) == 187 &&
 ord($charset[3]) == 191) {
  if ($auto == 1) {
   $rest = substr($contents, 3);
   rewrite ($filename, $rest);
   return ("<font color=red>BOM found, 
automatically removed.</font>");
  } else {
   return ("<font color=red>BOM found.
</font>");
  }
 }
 else return ("BOM Not Found.");
}

function rewrite ($filename, $data) {
 $filenum = fopen($filename, "w");
 flock($filenum, LOCK_EX);
 fwrite($filenum, $data);
 fclose($filenum);
}
?>

  • 上一條:請不要以安全的名義對客戶進行綁架
  • 下一條:公司對臨朐建設(shè)局網(wǎng)站升級SSL加密通信
  • 濰坊網(wǎng)站建設(shè),濰坊網(wǎng)站優(yōu)化,濰坊網(wǎng)站排名,濰坊網(wǎng)站改版,濰坊網(wǎng)站營銷策劃,濰坊網(wǎng)站制作,濰坊網(wǎng)站托管,濰坊網(wǎng)站百度排名,濰坊網(wǎng)站培訓(xùn),濰坊seo培訓(xùn),濰坊網(wǎng)絡(luò)公司

    地址:山東省濰坊奎文區(qū)新華路樂川街華誼大廈三樓

    網(wǎng)址:http://m.aalagrf.cn/ 垂詢電話:

    網(wǎng)站備案:魯ICP備14027302號-5

    copyright© 濰坊華邦網(wǎng)絡(luò)有限公司2011-2025