$arData = [
"NAME" => 'the title of the conference',
"CODE" => "",
"START" => '18.04.19 11:11:10',
];
telegramNotificationSend($id, $typeNotification, $arData);
$textNotification = "Conference" . $arData["NAME"] . " will soon begin. Start time in " . $arData["START"];
$textNotification = $dateStart . "The conference will begin shortly. Start time in ";
$data_string = json_encode ($data, JSON_UNESCAPED_UNICODE);
$curl = curl_init(TELEGRAM_BOT_URL);
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($curl, CURLOPT_POSTFIELDS, $data_string);
// Take in an array. (false - object)
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, array(
'key:' . TELEGRAM_BOT_KEY,
'Content-Type: application/json',
'Content-Length:' . strlen($data_string))
);
$result = curl_exec($curl);
curl_close($curl);
$data_string = json_encode ($data);
'Content-Type: application/json; charset=utf-8',
Find more questions by tags PHP