How can I find the last value in a multidimensional array in php?
Posted
by Chris
on Stack Overflow
See other posts from Stack Overflow
or by Chris
Published on 2010-03-19T02:35:42Z
Indexed on
2010/03/19
2:41 UTC
Read the original article
Hit count: 308
php
|multidimensional-array
I am using a multidimensional array and I am trying to use php to find the last value of one of the arrays and based on that last number(value), add one more to it.
Here is my multidimensional array structure:
$_SESSION['cart']['add_complete'][1]['deck_id']
I am trying to create this structure, but instead of where it says 1 now, I want to find out what the last number in the add_complete array is and then add one more to it and put that in the place of the 1. How can I do that?
© Stack Overflow or respective owner