本文主要讲解《UTF-8文件的BOM头的来由及去除方法》的详细内容
<</font>?php if (isset($_GET['dir'])) { //设置文件目录 $basedir = $_GET['dir']; } else { $basedir = '.'; } 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") . " "; } else { $dirname = $basedir . "/" . $file; checkdir($dirname); } } } closedir($dh); } } function checkBOM($filename, $auto = 1) { $contents = file_get_contents($filename); $charset[1] = substr($contents, 0, 1); $charset[2] = substr($contents, 1, 1); $charset[3] = substr($contents, 2, 1); |
本网刊登的文章均仅代表作者个人观点,并不代表本网立场。文中的论述和观点,敬请读者注意判断。
2021-02-24
2021-02-08
2021-02-08
2021-02-08
2021-02-08
2021-02-24
2021-02-08
2021-02-08