I can throw actual code here but it’s all rather long, so i am going to give an example:
[php]<?php
$max = 10; // max runs per exec
$arr = array_fill(0, 50, 0);
$last = file_get_contents(‘last.txt’);
$n = 0;
echo 'left off on '. $last;
while ($n < $max) {
foreach ($arr as $k => $v) {
if ($k > $last) {
// do something with the value ($v)
$n ++;
}
}
}
file_put_contents(last.txt, $k));
?>
it just feels wrong though, and i’m sure it is. especially the refresh. what is the best way to do this?
I would use array_slice instead of if ($k > $last), but that is normally comparing row values from a db, so i can’t just arbitrarily slice that.