Here I found a wonderful solution for recursively change the encoding of the files of one folder Randomseed solution
$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))
);
}
But there is a problem. Every file is changed, even images, and they are not shown later.
How to edit this for changing only .php
files for example?
Thank you very much!