Well, you can use
shift to knock off the first element in the array. It's difficult to say how you should do it after X seconds without seeing the rest of the code. I guess
sleep could be used but as I said it's difficult to know if it's possible without the rest of the code. (I mean, sleep will cause your program to "halt" (bad word, I know) for X seconds. Maybe use SIGALRM and alarm()?)
--
dempa