These files had UTF8 BOM, but i cleaned them:

'; foreach ($BOMBED as $utf) { echo $utf ."
\n"; } echo '

'; // 遞歸掃描 function RecursiveFolder($sHOME) { global $BOMBED, $WIN; $win32 = ($WIN == 1) ? "\\" : "/"; $folder = dir($sHOME); $foundfolders = array(); while ($file = $folder->read()) { if($file != "." and $file != "..") { if(filetype($sHOME . $win32 . $file) == "dir"){ $foundfolders[count($foundfolders)] = $sHOME . $win32 . $file; } else { ini_set('memory_limit', '-1'); $content = file_get_contents($sHOME . $win32 . $file); $BOM = SearchBOM($content); if ($BOM) { $BOMBED[count($BOMBED)] = $sHOME . $win32 . $file; // 移出BOM信息 $content = substr($content,3); // 寫回到原始文檔 file_put_contents($sHOME . $win32 . $file, $content); } } } } $folder->close(); if(count($foundfolders) > 0) { foreach ($foundfolders as $folder) { RecursiveFolder($folder, $win32); } } } // 搜索當前文檔是否有BOM function SearchBOM($string) { if(substr($string,0,3) == pack("CCC",0xef,0xbb,0xbf)) return true; return false; } ?>