How do I remove  from the beginning of a file?

前端 未结 23 1351
攒了一身酷
攒了一身酷 2020-11-22 06:21

I have a CSS file that looks fine when I open it using gedit, but when it\'s read by PHP (to merge all the CSS files into one), this CSS has the following characters prepend

23条回答
  •  野性不改
    2020-11-22 06:37

    I had the same problem. The problem was because one of my php files was in utf-8 (the most important, the configuaration file which is included in all php files).

    In my case, I had 2 different solutions which worked for me :

    First, I changed the Apache Configuration by using AddDefaultCharsetDirective in configuration files (or in .htaccess). This solution forces Apache to use the correct encodage.

    AddDefaultCharset ISO-8859-1
    

    The second solution was to change the bad encoding of the php file.

提交回复
热议问题