Free message notification function, with PHP Telegram interface how to write?

Source: Internet
Author: User
This article mainly introduces the free message notification function, how to write the Telegram interface in PHP? Interested friends under the reference, I hope to be helpful to everyone.

Using telegram interface, can achieve very convenient message reminders, without opening the app, without scientific networking, telegram notifications like SMS reminders.

The point is, free, no limit on the amount of use, don't worry about text content review, you want to send anything.

Here is the code for sending notifications using PHP:

<?php$bot_api_key = ' change here '; function Send_get ($urlstring) {$ch = Curl_init (); curl_setopt ($ch, Curlopt_url, $ URLString); curl_setopt ($ch, Curlopt_returntransfer, 1); curl_setopt ($ch, Curlopt_ssl_verifypeer, 0); curl_setopt ($ch, curlopt_ssl_verifyhost, 0); $result = curl_exec ($ch); Curl_close ($ch); return $result;} $text = @$_get["text"]; $tgid = @$_get["Tgid"];if ($text) {$url = "https://api.telegram.org/bot$bot_api_key/sendmessage chat_id= $tgid &text= $text "; echo Send_get ($url);} else{echo "Please Input";}? >

Pass in two parameters, text and Tgid.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.