I have a multilanguage site and I would like PHP to automatically set the language depending on the location from where you enter the site.
I tried a couple of ways.
localeconv()is not returning local language at all,nl_langinfo()was also not helpful at all,mb_language()returns not the language I was looking for,$_SERVER['HTTP_ACCEPT_LANGUAGE']this returned me a couple of languages instead of just one.setlocale(LC_ALL, 0)returnedCfor some reason.
But I failed to get the correct info every time.
I guess that setlocale(LC_ALL, 0) is the best solution, but I don't know what the returning C means and I don't know what to expect from different languages.
I looked for a solution on many different sites (including SO) and found the solutions I mentioned earlier. Unfortuately none of them did what I was looking for.