0
在这里我发现了一个奇妙的解决方案,递归更改一个文件夹Randomseed solution转换文件enconding递归
$path = realpath('C:\\your\\path');
$iterator = new RecursiveIteratorIterator(
new RecursiveDirectoryIterator($path),
RecursiveIteratorIterator::SELF_FIRST
);
foreach($iterator as $fileName => $file){
if($file->isFile())
file_put_contents(
$fileName,
iconv('ISO-8859-7', 'UTF-8', file_get_contents($fileName))
);
}
的文件的编码,但有一个问题。每个文件都被更改,甚至图像,他们不会稍后显示。 如何编辑这个仅用于更改.php
文件?
非常感谢!
工作完美。非常感谢你。 – Betty