The code I wrote shows garbled characters in all Chinese characters on the WEB.
邦乔维
邦乔维 2017-10-08 16:47:29
0
3
1417

I installed PHPSTUDY and wrote the code with notepad. All the Chinese characters displayed are garbled. What control is not installed properly?

邦乔维
邦乔维

reply all (3)
钟毅

Remember to change all pages, otherwise INCULDE specifically to include the utf8 sentence. Of course, if the modification is not completed, Chinese will not be displayed, only GBK text will be displayed.

    虫儿飞

    header('content-type:text/html;charset=utf-8');

      邦乔维

      //Declare variable $shouji
      $shouji = 'Sell a kidney for an iPhone';
      //Put $shouji in double quotes and then echo what is the effect? ?
      $str = "Will $shouji be displayed?";
      //Enter $str to try
      echo $str;
      ?>

      • reply The WEB display is normal if the codes are all in English, but as soon as Chinese characters are added, garbled characters are displayed.
        邦乔维 author 2017-10-08 17:03:26
      • reply Add a header in front of the code to define the HTML. Just enter the encoding. You can try it.
        phpcn_u40019 author 2017-10-08 19:12:29
      Latest Downloads
      More>
      Web Effects
      Website Source Code
      Website Materials
      Front End Template
      About us Disclaimer Sitemap
      php.cn:Public welfare online PHP training,Help PHP learners grow quickly!