Create PHP request script

so i want to run a service which will check new emails every "n" minutes from the database and send to intended receivers. this is what i can think of so far:

services.php

set_time_limit(0);

$data = json_decode(file_get_contents("php://input"), true);

header("Connection: close");
header("Content-length: " . (string) ob_get_length());
ob_end_flush();

if (@$data["op"] == "1min") {
    
    EmailQueue();
}
if (@$data["op"] == "5min") {
    
    SMSQueue();
}

as you can see from the above code there are two conditions to be applied based on data stream set on another script. so my question is, how can i create another script which can send stream of request to services.php simultaneously so that function EmailQueue and SMSQueue run every 1min and 5min respectively? note that i want to run the request from 1 script. Thanks in advance.

Answer

Solution:

You should use cron job for that

Source