I am trying to push a certain plain text as notification to users through telegram bot using the below mentioned segment of code. The issue that I am facing is that message is not getting pushed out at a given time. Please let me know what can I do. Any articles that I can read or go through.
The value of time obtained by me after echoing $time is correct.
I am coding in PHP
<?php
date_default_timezone_set('Asia/Kolkata');
$time = date("h:i:sa");
$timezone = date("e");
if ($time == "12:00:00pm") {
$request_url = $website."/sendMessage?chat_id=745775755&text=<b>You are receiving this message as a notification&disable_web_page_preview=true&parse_mode=HTML";
file_get_contents($request_url);
}
?>
Is there any way to automate it and send this regularly at 12:00:00pm whenever this if condition holds true?