I want to schedule a php function to execute at a user's inputted scheduled time. Also my website is hosted in windows machine so I am looking for a windows based solution. I have made a function which looks like this:
function sendemail()
{
$cmd = 'schtasks /create /sc ONCE /tn emailtask /tr http://example.com/index.php/emailnotifications/sendemail';
exec ($cmd);
}
In the above code emailnotifications is my controller and sendemail is my function where I have written my code. Does anyone know a solution to create scheduled task in windows task schedular using php code?