Is relying on $_SERVER['HTTP_ACCEPT_LANG'] ok for multilingual support?
Are there any pitfalls or downsides to relying on $_SERVER['H开发者_开发知识库TTP_ACCEPT_LANG'] for language detection?
I think, this is actually the best way, as long as you enable users to switch the language afterwards and remember their decision (e.g. in a cookie). You also need a fallback for unsupported languages.
It is very common in Europe at least that browsers are configured with English as the native or only language even though the real native language is something different. As long as you make it easy for your users to set (and keep) their preferred language through your site, you should be safe.
精彩评论