I'm facing a problem with a Telegram API encoding. Messages are working normally, but they are all coming in duplicate, what can they be?
Follow function:
function sendMessage($chatID, $messaggio, $token) {
$url = "https://api.telegram.org/" . $token . "/sendMessage?chat_id=" . $chatID;
$url = $url . "&text=" . urlencode($messaggio);
$ch = curl_init();
$optArray = array(
CURLOPT_URL => $url,
CURLOPT_RETURNTRANSFER => true
);
curl_setopt_array($ch, $optArray);
$result = curl_exec($ch);
curl_close($ch);
Follow the call:
$token = "bot******************";
$chatid = "***********";
sendMessage($chatid,"mensagem aqui!", $token);
I read something about offset, but I do not know how to start implementing this in code ... If anyone can help me, I'm grateful!
---- update ----- Follows while from fatch_assoc where there is the sending function + sendMessage
$result_alerta = mysql_query( $query_alerta );
while ( $row_alerta = mysql_fetch_assoc( $result_alerta ) )
{ funções aqui }
---- update ----- follow query result link