I would like to run part of php code asynchronously. I want to run the insertnumber() function after 60seconds but without delaying the whole code.
echo json_encode($returnArray);
if ($timeout=="1")
{
sleep(60);
$connection->insertnumber($finalnumber,"Loser");
}
This method delay the whole code by 60 secs. I want that part of the code to run in the background without affecting the original code and then executing the insernumber() function after 60 secs.