-1
我使用此代码,但似乎串无法正确显示(TRA DJI)保持字符串的原始字符编码在PHP
<?php
header ('Content-type: text/html; charset=utf-8');
$msg = $_GET['msg'];
$command = substr($msg,0,8);
if (($command == 'tra điểm') or ($command == 'Tra điểm')) {
$string = array(
"text" => "done",
);
$mjson = json_encode($string);
echo '{"messages":['.$mjson.']}';
}
echo $command;
?>
我什么都试过,但我不能修复它,请帮助。
确保你的php文件是用utf-8编码的(例如使用记事本+ +)然后在页面的开始处(在<?php'标签之前) –