Home > Backend Development > PHP Tutorial > php Ajax乱码_php技巧

php Ajax乱码_php技巧

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-05-17 09:37:31
Original
808 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;
?>

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