function send_telegram($bot,$chat,$msg){ $url = "https://api.telegram.org/bot$bot/sendMessage"; $post = [ 'chat_id' => $chat, 'text' => $msg ]; $ch = curl_init(); curl_setopt_array($ch, [ CURLOPT_URL => $url, CURLOPT_RETURNTRANSFER => true, CURLOPT_POST => true, CURLOPT_POSTFIELDS => $post, CURLOPT_SSL_VERIFYPEER => false, CURLOPT_TIMEOUT => 10, ]); curl_exec($ch); curl_close($ch); }