How to set page encoding in php

coldplay.xixi
Release: 2023-03-06 08:14:02
Original
2321 people have browsed it

php method to set page encoding: output the meta tag in the php mvc controller or php page, the code is [echo '

How to set page encoding in php

php method to set page encoding:

1. Output in the controller of php mvc or php page meta tag

echo &#39;<meta http-equiv="content-type" content="text/html; charset=utf-8">&#39;;
Copy after login

in php page or html page

<meta http-equiv="content-type" content="text/html; charset=utf-8">
Copy after login

2. Use header function

to add statements in the controller or page:

header("content-type:text/html; charset=utf-8");
Copy after login

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!

Related labels:
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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!