Home  >  Q&A  >  body text

The code I wrote shows garbled characters in all Chinese characters on the WEB.

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

邦乔维邦乔维2591 days ago1473

reply all(3)I'll reply

  • 钟毅

    钟毅2017-10-09 20:24:45

    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.

    reply
    1
  • 虫儿飞

    虫儿飞2017-10-09 11:29:53

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

    reply
    1
  • 邦乔维

    邦乔维2017-10-08 17:02:40

    <?php
    //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
    0
  • 邦乔维

    The WEB display is normal if the codes are all in English, but as soon as Chinese characters are added, garbled characters are displayed.

    邦乔维 · 2017-10-08 17:03:26
    phpcn_u40019

    Add a header in front of the code to define the HTML. Just enter the encoding. You can try it.

    phpcn_u40019 · 2017-10-08 19:12:29
  • Cancelreply