halebs Posted March 31, 2007 Share Posted March 31, 2007 Have the following projects array. Array ( [\0] => Array ( [id] => 24 [type] => p ) [1] => Array ( [id] => 23 [type] => p ) [2] => Array ( [id] => 18 [type] => p ) [3] => Array ( [id] => 6 [type] => s ) [4] => Array ( [id] => 3 [type] => s ) [5] => Array ( [id] => 8 [type] => s ) ) I am wondering if it is possible to identify the index of a multidimensional array (0-5) given one of its elements (id in this case). I am trying to create next and previous links on a page. For example, if someone clicks on a project with the id of 18 (index [2]), would it be possible to refer back to the array and extract the id for the record before (23) and the next record (6) so I could create the appropriate next and previous links on a page? Link to comment https://forums.phpfreaks.com/topic/45086-help-with-multidimensional-array/ Share on other sites More sharing options...
Psycho Posted March 31, 2007 Share Posted March 31, 2007 Well, in order to access id 18 you would have to have known that it was in the parent index of 2, so you should be able to deduce what the next and previous links are from that. Or am I missing something. Link to comment https://forums.phpfreaks.com/topic/45086-help-with-multidimensional-array/#findComment-218869 Share on other sites More sharing options...
halebs Posted April 1, 2007 Author Share Posted April 1, 2007 Thanks for your time! I figured out a solution. Link to comment https://forums.phpfreaks.com/topic/45086-help-with-multidimensional-array/#findComment-218933 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.