[php]
read())) {
if ($entry == '.' || $entry == '..') {
continue;
}
$filename = $path . directory_separator . $entry;
// echo $filename, \n;
if (is_dir($filename)) {
scanddir($filename);
} else {
bomtoutf8($filename);
}
}
}
read())) {
if ($entry == '.' || $entry == '..') {
continue;
}
$filename = $path . directory_separator . $entry;
// echo $filename, \n;
if (is_dir($filename)) {
scanddir($filename);
} else {
bomtoutf8($filename);
}
}
}
友情提示:代码是批量处理目录下(包括子目录)的所有带bom文件,使用前需备份
http://www.bkjia.com/phpjc/477261.htmlwww.bkjia.comtruehttp://www.bkjia.com/phpjc/477261.htmltecharticle[php] ?php $path = dirname(__file__); scanddir($path); function bomtoutf8($filename) { $ef = 239; $bb = 187; $bf = 191; if (is_dir($filename)) return; $fd = fopen($filename, rb); i...