I just started learning PHP, configured apache2.4 php7, and wrote a few lines with Notepad
<?PHP
echo "Welcome to PHP!";
?>
When opened with IE and Google, Chinese characters are displayed as garbled characters. . . I haven't been able to find the answer for a whole day. . Seeking experts. .
Hello World!2018-08-06 14:40:30
Need to add at the top of the PHP file: header('Content-type:text/html;charset=utf-8');
无名指2018-08-06 08:16:09
Try adding a sentence before the output: header("Content-type:text/html;charset=utf-8");