Check whether the encoding format of the project is UTF-8 (Recommended learning: PHP programming from entry to proficiency)
Add the following code at the beginning of the page
<?php header("content-type:text/html;charset=utf-8"); //设置编码 ?>
If it is a PHP file that mixes HTML and PHP languages, is also required Under the ; tag, add the following code:
<meta charset="UTF-8">
The above is the detailed content of php file content is garbled. For more information, please follow other related articles on the PHP Chinese website!