I have records in the database, which need to be accessed 10 by 10, from the latest to oldest. I need to take 10, check some values and possibly modify them, and when I am finished with these 10, continue to the next 10. I already saved the values in an array, but I am not sure how to dynamically take 10 by 10, without using array_splice, because the number of records is not known, so I cannot use the indices.
Asked
Active
Viewed 20 times
-3
-
Why do you need to take them 10 at a time, precisely? Why is that a limitation? It sounds a bit arbitrary. Can the results of the first 10 affect how you process the second 10, for example? Otherwise I can't really think of a reason why you'd need to have this requirement. Or are you trying to implement paging in your UI but just described it in an unusual way? – ADyson May 11 '22 at 14:09