search

Home  >  Q&A  >  body text

Newbies ask for advice on garbled characters

APache2.4 PHP7.0 win10 Home Edition

After setting up the environment, hello PHP can be displayed as shown below

捕获1.PNG

But when the following program is executed

<HTML>
<HEAD>
    <TITLE> </TITLE>
</HEAD>
<BODY>
<?php
  $room = 20;
  function showrooms(){
      echo $room;
  }
  showrooms();
  echo $room.'间房间。';
?>
</BODY>
<HTML>

This kind of garbled code appears

捕获.PNG

Please give some advice!

老实小胖老实小胖2496 days ago1151

reply all(5)I'll reply

  • 老实小胖

    老实小胖2018-03-06 21:00:12

    It has been solved, thank you for your help! Just change it to UTF8 in the encoding options of notepad捕获4.PNG

    reply
    0
  • 66

    662018-03-06 16:45:11

    Encoding problem, check whether the encoding of your editor is consistent with the encoding of the browser

    reply
    0
  • 路过

    路过2018-03-06 08:24:39

    Maybe your code is not in utf8 format when you save it


    reply
    1
  • 老实小胖

    老实小胖2018-03-05 22:15:07

    grateful! But I tried it, but it still didn’t work. 捕获2.PNG

    Source code of the web page:

    捕获3.PNG

    reply
    0
  • 辉

    2018-03-05 21:50:00

    Add this paragraph to <head></head>

    <meta charset="UTF-8">

    The default character set problem of the browser system.


    reply
    1
  • Cancelreply