I am Vietnamese and I want to use PHP to get a list of files in a directory that uses utf-8 characters.
My hope output is an array of files: array("music/Nhạc Thiền Tĩnh Tâm 1.mp3","music/Nhạc Thiền Tĩnh Tâm 2.mp3","music/Nhạc Thiền Tĩnh Tâm 3.mp3","...");
My code:
<?php
foreach (glob("music/*.mp3") as $ds) {
echo $ds . "<br>";
}
I use the glob()
function.My hope output is an array of files: array("music/Nhạc Thiền Tĩnh Tâm 1.mp3","music/Nhạc Thiền Tĩnh Tâm 2.mp3","music/Nhạc Thiền Tĩnh Tâm 3.mp3","..."); But the return list is an empty array. How can I do that in PHP 5.6 on Windows? Please help me!