How to modify PHP Chinese characters to display garbled characters on the web page
永恒之蓝
永恒之蓝 2019-04-25 10:41:00
0
1
778
<?php
header("content-type:text/html;charset=utf-8");
$host = 'localhost';
$username = 'root';
$password = 'root';
$dbname = 'student_info';
//$db = new mysqli($host,$username,$password,$dbname);
$db = mysqli_connect($host,$username,$password,$dbname);
mysqli_set_charset($db,'utf8_encode');
if($db){
	//echo "MySql connection successful";
	echo "MySql连接成功!";
}
/*
$link = mysqli_connect($host,$username,$password);
mysqli_select_db($link, $dbname);
if($link){
	echo "MySql connection successful";
}*/
?>


永恒之蓝
永恒之蓝

reply all(1)
永恒之蓝

The problem is solved because my notepad development tool is of other encoding type

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