Home > php教程 > php手册 > php Ajax乱码

php Ajax乱码

WBOY
Release: 2016-06-13 12:29:16
Original
1225 people have browsed it


而AJAX支持UTF8
好了,先在PHP页上加个header(”content-type:text/html; charset=utf-8″);
告诉网页这个实现的编码是UTF-8
然后把要输出的内容用$test = iconv('gbk', ‘utf-8′, $test);转一下编码
然后在输出
大家有兴趣可以看看
 header(”content-type:text/html; charset=utf-8″); 
$test=”我是中文”; 
echo $test; 
$test = iconv('gbk', ‘utf-8′,$ test); 
echo $test;
?>

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 Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template