APache2.4 PHP7.0 win10 Home Edition
After setting up the environment, hello PHP can be displayed as shown below
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
Please give some advice!
It has been solved, thank you for your help! Just change it to UTF8 in the encoding options of notepad
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.
Source code of the web page:
Add this paragraph to <head></head>
<meta charset="UTF-8">
The default character set problem of the browser system.