php method to set page encoding: output the meta tag in the php mvc controller or php page, the code is [echo '
php method to set page encoding:
1. Output in the controller of php mvc or php page meta tag
echo '<meta http-equiv="content-type" content="text/html; charset=utf-8">';
in php page or html page
<meta http-equiv="content-type" content="text/html; charset=utf-8">
2. Use header function
to add statements in the controller or page:
header("content-type:text/html; charset=utf-8");
If you want to know more about programming learning, please pay attention to the php training column!
The above is the detailed content of How to set page encoding in php. For more information, please follow other related articles on the PHP Chinese website!