I uses this code, but it seems substring can't display correctly ( tra đi� )
<?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;
?>
I tried everything but I can't fix it, please help.