[eluser]NetStranger[/eluser]
i modernizate default directory_helper :
Code:
if ( ! function_exists('directory_map'))
{
function directory_map($source_dir, $top_level_only = FALSE)
{
if ($fp = @opendir($source_dir))
{
$source_dir = rtrim($source_dir, DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR;
$filedata = array();
while (FALSE !== ($file = readdir($fp)))
{
if (strncmp($file, '.', 1) == 0)
{
continue;
}
if ($top_level_only == FALSE && @is_dir($source_dir.$file))
{
$temp_array = array();
$temp_array = directory_map($source_dir.$file.DIRECTORY_SEPARATOR);
$file = iconv("windows-1251", "UTF-8", $file); // HERE !!!
$filedata[$file] = $temp_array;
}
else
{
$filedata[] = $file;
}
}
closedir($fp);
return $filedata;
}
}
}
now it takes me right names of the folders , BUT if i want to get list of files in this cyrillic folder , i get an error! i think my problem is $source_dir ... but i dont know how to solve the problem (((