My array looks like this:
Array
( [myarr] => Array (
[504] => 2
[508] => 25
)
)
Is it possible to echo a certain position of this array? I have tried:
echo $_SESSION['myarr'][0][0];
I can’t seem to get anything to echo back.
EDIT: to be more specific.. Is it possible to echo it based on numeric index?
Use
array_keys()to get the keys into an array. Then access the 2D array using indexes in the keys array. Not that this is the best way to do this but it is a way to use numeric indexes to solve your problem.