Newbies ask for advice on garbled characters
老实小胖
老实小胖 2018-03-05 21:31:52
0
5
1110

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!

老实小胖
老实小胖

reply all(5)
老实小胖

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

黄天敏

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

路过

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


老实小胖

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

Source code of the web page:

捕获3.PNG

辉

Add this paragraph to <head></head>

<meta charset="UTF-8">

The default character set problem of the browser system.


Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template