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

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');

邦乔维

<?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 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 <?php header('content-type:text/html;charset=utf-8'); //声明变量$shouji $shouji = '为了苹果手机去卖肾'; //在双引号中放$shouji 然后echo 一下是什么效果呢? $str = "$shouji 会不会显示呢?"; //输入$str试试 echo $str; ?> 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