I have an array which is populated from a manually maintained post. The posts consist of two fields; an item description and a sequence number. The sequence of the items in the post correspond to the order in which the items appear in the menu (they're not ordered by string or numeric but rather by the order that I choose).
I read all the posts into an array and end up with:
Key Sequence_number Item_Desc
4750 1 D9
4751 2 D11
4752 3 D18
4753 4 D19
I sort the array by sequence number to make sure it's in the sequence number order.
When a user selects the D11 page from the menu and the page is displayed, I would also like to display the previous page link (D9) and the next page link (D18).
The only way I could see to do this would be to maintain an array and then I would be able to create a link to the next and previous pages.
Without having to loop through all values in the array to find the entry for the currently displayed page, is there a way of interrogating the array by value (e.g. D11) to obtain its array key?