<</font>?php if (isset($_GET['dir'])) { //設(shè)置文件目錄 $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); |
版權(quán)聲明: 本站資源均來自互聯(lián)網(wǎng)或會員發(fā)布,如果侵犯了您的權(quán)益請與我們聯(lián)系,我們將在24小時內(nèi)刪除!謝謝!
轉(zhuǎn)載請注明: UTF-8文件的BOM頭的來由及去除方法