How to set up php page encoding

WBOY
Release: 2016-07-29 09:12:34
Original
1149 people have browsed it

输出meta标签

1、在php mvc的控制器里面或php页面

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

2、在php页面或html页面

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

使用header函数

在控制器或页面里面

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

附录:当遇到一个页面两种编码的时候,有可能是html文件和引入的js、css文件之间编码不匹配,可以在引入标签中添加charset选项来解决这个问题。

').addClass('pre-numbering').hide(); $(this).addClass('has-numbering').parent().append($numbering); for (i = 1; i ').text(i)); }; $numbering.fadeIn(1700); }); });

版权声明:欢迎转载、分享、交流!

以上就介绍了php页面编码设置的方法,包括了a标签方面的内容,希望对PHP教程有兴趣的朋友有所帮助。

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