Hello everyone,
I've got the following problem:
I want to know the number of the row that a certain value has in an array, because I want to calculate in advance on which page my item has to appear.
I know how many items I can display on one webpage and I know the total number of items I have to display. Ergo, I already know how many pages I will have. For example: 75 items, 25 items per page = 3 pages. BUT, now I want to know on what page ONE particular item will appear.
I want to do this by searching for this item in the array and retrieving the number row on which the item appears in the array. The row number is like the number of the item on my webpage, so if the row number in the array is for example 27, I know that my item will appear on page 2 (25 items per page)
Now the question is: how do I best do this, keeping in mind that the performance of the page may not suffer too much, because it is the index page of the website. Or if anyone has another suggestion/another way of dealing with this, please let me know!
Thanks in advance!
Cheers
LotusE
I've got the following problem:
I want to know the number of the row that a certain value has in an array, because I want to calculate in advance on which page my item has to appear.
I know how many items I can display on one webpage and I know the total number of items I have to display. Ergo, I already know how many pages I will have. For example: 75 items, 25 items per page = 3 pages. BUT, now I want to know on what page ONE particular item will appear.
I want to do this by searching for this item in the array and retrieving the number row on which the item appears in the array. The row number is like the number of the item on my webpage, so if the row number in the array is for example 27, I know that my item will appear on page 2 (25 items per page)
Now the question is: how do I best do this, keeping in mind that the performance of the page may not suffer too much, because it is the index page of the website. Or if anyone has another suggestion/another way of dealing with this, please let me know!
Thanks in advance!
Cheers
LotusE