Home >Backend Development >PHP Tutorial >php Ajax garbled code_PHP tutorial
And AJAX supports UTF8
Okay, first add a header on the PHP page ("content-type: text/html; charset=utf-8");
Tell the web page that the encoding of this implementation is UTF -8
Then use $test = iconv('gbk', 'utf-8′, $test); to convert the content to be output
and then output
If you are interested, you can take a look
header(”content-type:text/html; charset=utf-8″);
$test=”I am Chinese”;
echo $test;
$test = iconv('gbk', 'utf-8′,$ test);
echo $test;
?>