4
I have an array of users and need to make a looping between them. It will work like this, every time someone makes a request on the page, I need to be recorded in the database the next user of what was previously chosen.
This is my array, which I take from registered users, this array can change.
array(
(int) 1 => 'Joao',
(int) 6 => 'Pedro',
(int) 7 => 'Luiz',
(int) 9 => 'Vinicius'
)
That is, if in the previous request who was chosen was the Pedro
(picked up the id that was saved earlier) , need that next time he save the id
of the Luiz in the BD, and so on...
My doubt is on, how to "walk" with the values of this array based on the last recorded value?