Search
 
SCRIPT & CODE EXAMPLE
 

PHP

php send telegram message to user

function sendMessage($chatID, $messaggio, $token) {
    echo "sending message to " . $chatID . "
";

    $url = "https://api.telegram.org/bot" . $token . "/sendMessage?chat_id=" . $chatID;
    $url = $url . "&text=" . urlencode($messaggio);
    $ch = curl_init();
    $optArray = array(
            CURLOPT_URL => $url,
            CURLOPT_RETURNTRANSFER => true
    );
    curl_setopt_array($ch, $optArray);
    $result = curl_exec($ch);
    curl_close($ch);
    return $result;
}
Comment

php send telegram message to user

$token = "<insert bot token here>";
$chatid = "<chatID>";
sendMessage($chatid, "Hello World", $token);
Comment

PREVIOUS NEXT
Code Example
Php :: php combine arrays 
Php :: laravel collection search by value 
Php :: add seconds to datetime php 
Php :: separate numbers with commas laravel 
Php :: php last day of month 
Php :: php sort array by value length 
Php :: html_entity_decode (PHP 4 = 4.3.0, PHP 5, PHP 7, PHP 8) html_entity_decode — Convert HTML entities to their corresponding characters 
Php :: why pusher not working in laravel 
Php :: display time php 
Php :: php sort associative array by specific value 
Php :: get ip country 
Php :: how to add values to an array in laravel 
Php :: laravel run migration specific file 
Php :: laravel iteration 
Php :: carbon equal dates 
Php :: php var_export to string 
Php :: how to go to another folder in php 
Php :: php uppercase first letter 
Php :: call php from html 
Php :: laravel 8 route 
Php :: laravel delete controller still cached 
Php :: wordpress get post type 
Php :: php array length for loop 
Php :: Fatal error: Allowed memory size of 1610612736 bytes exhausted but already allocated 1.75G 
Php :: laravel delete file after download 
Php :: eloquent with select 
Php :: live update mysql data in php 
Php :: laravel search user details by specific role 
Php :: datetime blade laravel 
Php :: PHP print — Output a string 
ADD CONTENT
Topic
Content
Source link
Name
9+6 =