I have an array with about 500+ elements. These elements will be checked in a function and then I will have to grab data from an API for each element (every element is one query), that does not allow me that much requests in a short time. I will have, to run a delayed loop, that will very likely exceed 30 secs.
What I want is, that my PHP-script should do a certain amount of checks/requests and remove from the "todo"-list and then self refresh and continue the jobafter ~2 sec.
A cronjob will start this php-script.
How can I manage PHP to restart a script after "work is done" or after some kind of "failure" occurs? It depends on this thing, on how I store the data from the "todo-list"-array into either a file, or a $_SESSION. Don't want to store this into a DB.
How can I solve this without the need to setup something on the server, or outside of the script itself?