Is there a way to print a set number of items in an array?
So for example, print the first 3 items in $array. Then later on print the next 3 items in $array.
Any suggestions?
Thanks alot
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
That’s just off the top of my head, and assumes the array is numbered sequentially. The static variable keeps track of where you were in the array, no matter how many times you call it. So calling
Would print the first three elements, then
Would print the next two, etc.