Telegram BotApi, Send message to multiple chat_id

In addition to @farsad 's answer: Add sleep(NUMBER_OF_SECONDS); inside the foreach loop to not get banned by telegram. As there is a limit of 30 messages per second for bots in Telegram API



There is no way to make bot to sendMessage to multiple chat id but there is a trick that can fix it for now :)
Why not sending each chat id a message ?!
Let's look at this example in PHP :

<?php
$message = "Hi John";
$chatIds = array("xxx","xxx","xxx"); // AND SOME MORE
foreach($chatIds as $chatId) {
    // Send Message To chat id
    file_get_contents("https://api.telegram.org/botTOKKEN/sendMessage?chat_id=$chatId&text=".$message);
}
?>