PHP 5.6 upgrade and special characters

前端 未结 4 881
你的背包
你的背包 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 09:59

    PHP 5.6 changes the default value of default_charset to UTF-8. The value should better be set.

    If the charset of your php files is ISO-8859-1 (all in the directory) you can easy put a .htaccess File in the root directory:

    php_value default_charset ISO-8859-1
    

    If only some of your files are in ISO-8859-1 you can easy send a header in the first line of the php file (no need for default_charset):

    
    

    Or convert the encoding of php textfiles to utf8 and don't change defaults.

提交回复
热议问题