adx Posted April 21, 2009 Share Posted April 21, 2009 Hey there. I've been ogling this for a little while and have completely lost my mind. The thing is that I want to get the key digit of the last chunk generated by array_chunk. So in the following.. Array ( [0] => Array ( [0] => a [1] => b ) [1] => Array ( [0] => c [1] => d ) [2] => Array // I need this number? ( [0] => e ) ) No matter what I do I can only seem to get b,d,e or one of the three. Array key number 2 seems to fall between the cracks. Can I retrieve this as a numeric value? Thanks! Link to comment https://forums.phpfreaks.com/topic/155051-solved-how-to-get-the-number-of-the-last-array-chunk/ Share on other sites More sharing options...
Mchl Posted April 21, 2009 Share Posted April 21, 2009 count - 1 Link to comment https://forums.phpfreaks.com/topic/155051-solved-how-to-get-the-number-of-the-last-array-chunk/#findComment-815491 Share on other sites More sharing options...
adx Posted April 21, 2009 Author Share Posted April 21, 2009 Thanks for the reply, but could you be more specific as to how to apply that? Link to comment https://forums.phpfreaks.com/topic/155051-solved-how-to-get-the-number-of-the-last-array-chunk/#findComment-815498 Share on other sites More sharing options...
Mchl Posted April 21, 2009 Share Posted April 21, 2009 $lastIndex = count($array) - 1; Link to comment https://forums.phpfreaks.com/topic/155051-solved-how-to-get-the-number-of-the-last-array-chunk/#findComment-815501 Share on other sites More sharing options...
adx Posted April 21, 2009 Author Share Posted April 21, 2009 Thanks, just figured that out. The variable was being double timed somewhere down the page giving me zero's. My mind kinda feels like an array chunk right about now! Thanks my man! Link to comment https://forums.phpfreaks.com/topic/155051-solved-how-to-get-the-number-of-the-last-array-chunk/#findComment-815506 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.