maddogandnoriko Posted May 17, 2009 Share Posted May 17, 2009 I have an array that has had elements removed so the keys are as such: 3,4,6,9 etc. I now need to retrieve a specific range of elements for pagination, ie. 0-10, is it possible to just renumber the keys 0-whatever? Thank you Todd Link to comment https://forums.phpfreaks.com/topic/158452-solved-renumber-array-keys/ Share on other sites More sharing options...
Ken2k7 Posted May 17, 2009 Share Posted May 17, 2009 Cheap way array_merge(array(), $array); Link to comment https://forums.phpfreaks.com/topic/158452-solved-renumber-array-keys/#findComment-835636 Share on other sites More sharing options...
sasa Posted May 17, 2009 Share Posted May 17, 2009 array_values() function Link to comment https://forums.phpfreaks.com/topic/158452-solved-renumber-array-keys/#findComment-835648 Share on other sites More sharing options...
Ken2k7 Posted May 17, 2009 Share Posted May 17, 2009 array_values() function Nice one. sasa karma++ Link to comment https://forums.phpfreaks.com/topic/158452-solved-renumber-array-keys/#findComment-835653 Share on other sites More sharing options...
maddogandnoriko Posted May 17, 2009 Author Share Posted May 17, 2009 exactly what was needed! Thank you very much. Todd Link to comment https://forums.phpfreaks.com/topic/158452-solved-renumber-array-keys/#findComment-835879 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.