<</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); |
版权声明: 本站资源均来自互联网或会员发布,如果侵犯了您的权益请与我们联系,我们将在24小时内删除!谢谢!
转载请注明: UTF-8文件的BOM头的来由及去除方法