0
SCANDIRのPHPのパスアドレスにUTF8文字を使用する方法
私のフォルダ名は次のとおりです。61-تستتست
私はSCANDIRに誤りがあり、 DirectoryIterator
変更後のフォルダ名はになりましたが、私の問題は解決しましたが、名前が必要です。
$folder = '61-تست تست';
$path = 'files/'.$folder;
print_r(scandir($path));
foreach (new \DirectoryIterator($path) as $file) {
if(!$file->isDir())
{
echo $file->getFilename() . "<br>";
}
}
エラー:PHP 5.6 LINUXで
UnexpectedValueException
The system cannot find the file specified. (code: 2)
DirectoryIterator::__construct(D:/wamp64/www/project/web/files/61-تست تست,D:/wamp64/www/project/web/files/61-تست تست): The system cannot find the file specified. (code: 2)
سلام。 دوتالینکرویهنگاهیبنداز: https://stackoverflow.com/questions/22990072/scandir-in-php-with-special-hungarian-characters https://stackoverflow.com/questions/3544772/readdir-and -scandir بعدشگوگلروهمبگرد、حتماکسیبودهبااینمشکلبرخوردهباشه: https://www.google.com/search?sclient=psy-ab&q=utf8+Scandir+php&oq=utf8+Scandir+php&gs_l=serp .3 ... 90157.97443.0.100148.7.7.0.0.0.0.0.0.0.0 .... 0 ... 1.1.64.psy-ab..7.0.0.uRgxw9rYKHs&pbx = 1&bav = on.2、または。 &biw = 1024&bih = 662&ech = 1&psi = 5YlqWfWOJ8PVwQLFzZnIDw.1500154339585.3&ei = 5YlqWfWOJ8PVwQLFzZnIDw&emsg = NCSR&noj = 1 موفقباشی – msoa