I have a weird problem. On my development server all stuff works but on the live server it doesn’t. I have a folder with a special char like “ö” in it. On the development server i do this to check if the filename is a directory ($dir = “coördinatie”):
if (is_dir(urldecode($dir)))
echo "true";
else {
echo "false";
}
The result is true. On the live server the result is false. The weird thing is… a hardcoded string works fine and the result is true. Like this:
if (is_dir("coördinatie"))
echo "true";
else {
echo "false";
}
I tried typecasting to string and such but i can’t figure it out. Hope someone has a clue.
My guess would be this:
urldecodegenerally decodes to UTF-8.Your hardcoded string may be in Latin-1, since the source code is saved as such.
The file system (functions) on your local machine like Unicode, the ones on production like Latin-1.
You may have to convert the string into an encoding that your file system expects.
You can confirm my suspicion by comparing the values of
bin2hexfor both strings.