Hy, i have this php code for telegram bot:
header("Content-Type: application/json");
$parameters = array('chat_id' => $chatId, "text" => '' .$temp.'°C');
$parameters["method"] = "sendMessage";
echo json_encode($parameters);
The problem is the encode of output, this will be & deg;C, i need °C.
If I use °, the code not work.
Solved with this code:
header("Content-Type: application/json; charset=utf-8', true,200");
$parameters = array('chat_id' => $chatId, "text" => '' .$temp.'°C');
$parameters["method"] = "sendMessage";
$parameters = array_map('utf8_encode', $parameters);
echo json_encode($parameters);