I am struggling with creating directories when foreign characters are in use. There is no problem when I use this character 'ó', but when I try with characters like ź,ż,ń,ć,ś there is no success.
Here is an example:
$directory = 'customers/ć';
$directory = mb_convert_encoding($directory, 'ISO-8859-1', 'utf-8');
//I use this line to correctly display the foreign character
if (!is_dir($directory)) {
$mode = 0777;
mkdir($directory, $mode, true);
}
else {
echo "something went wrong";
}
Thank you Robert
Convert to UTF-8 without specifying the current code:
$directory = mb_convert_encoding($directory, 'utf-8');