I am using Windows 2003 to write some PHP code. I use XAMPP Portable (copy to D:). The problem:
$path = 'D:\ebooks';
$all_file = scandir($path);
foreach ($all_file as $file) {
if (is_dir("$path/$file") && $file != '.' && $file != '..') {
echo $file . "<br />
";
}
}
When I call the script (with browser), I didn't see any directories (within D:\ebooks) containing a Unicode character (I tested with Vietnamese, Japanese, Chinese, Czech).
But if I remove is_dir("$path/$file")
, the directories display with many strange characters and many ???
characters.
How can I solve the problem?