Home > Backend Development > PHP Tutorial > php+mysql+html页面编码解决方案

php+mysql+html页面编码解决方案

WBOY
Release: 2016-06-23 13:13:46
Original
850 people have browsed it

1.html抬头需加入编码设置标签```<meta charset="UTF-8">```需要注意网页中的php放在body中...2.php编码```header("Content-type: text/html;charset=utf-8");```3.写入mysql编码在php中代码示例:```$mysqli=new mysqli("localhost","root","","xxxx");$mysqli->query("set names utf8;");```4.数据库中相关字段编码设置为“utf8”这些都搞定了编码问题就也搞定啦
Copy after login

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template