Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (!function_exists('sendTelegram')) {
- function sendTelegram($html)
- {
- if (!empty($html)){
- $html = str_replace('<br>', ' \n ', $html);
- $html = urlencode($html);
- $html = str_replace('+%5Cn', '%0D%0A', $html);
- $curl_url = 'https://api.telegram.org/bot6755709714:AAG6ZPeZKiShrmSacG7O338EUZvmUO4WFmU/sendMessage?chat_id=-4110507425&parse_mode=HTML&disable_web_page_preview=True&text=' . $html . '';
- $curl = curl_init();
- curl_setopt_array($curl, array(
- CURLOPT_URL => $curl_url,
- CURLOPT_RETURNTRANSFER => true,
- CURLOPT_ENCODING => '',
- CURLOPT_MAXREDIRS => 10,
- CURLOPT_TIMEOUT => 0,
- CURLOPT_FOLLOWLOCATION => true,
- CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
- CURLOPT_CUSTOMREQUEST => 'GET',
- ));
- $response = curl_exec($curl);
- curl_close($curl);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement