PHP 5.6 upgrade and special characters

前端 未结 4 891
你的背包
你的背包 2021-01-12 09:28

I have a website where I\'ve used php to include sections rather than having code be duplicated for each page.
However, recently my webhost upgraded the PHP to 5.6, and

4条回答
  •  广开言路
    2021-01-12 10:00

    If you have multi host web server especially with older websites and multiple languages, for maximum compatibility with earlier PHP versions like 5.4 just force reset default_charset value in /etc/php.../php.ini:

    In the global [PHP] section find this key and edit, or put like this:

    default_charset = ""
    

    This will not force PHP to set UTF-8 charset for all php files, especially older legacy or national encoding like windows-1251, windows-1257, iso-8859-1, iso-8859-2, ISO-8859-13 and similar.

    Or if you are developer, sure use Rob's answer and add code directly to you php application ini_set("default_charset", "");

提交回复
热议问题