<?php
$parameters = array(
"chat_id" => "******",
"text" => "Hello",
"disable_web_page_preview" => "true",
"parse_mode" => "Markdown"
);
send($parameters);
function send($parameters)
{
$bot_token = "*********";
$url = "https://api.telegram.org/bot$bot_token/sendMessage";
if (!$ch = curl_init())
{
exit();
}
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $parameters);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$outpot = curl_exec($ch);
return $outpot;
}
?>
This is my code but it is not working.
I want to send some messages to the telegram bot.