I have an array like this:
Array (
[0] => Array (
[0] => 510
[1] => 984
[2] => 1045
[3] => 2068
[4] => 1054
[5] => 673
)
[1] => Array (
[0] => 1163
[1] => 1982
[2] => 2067
[3] => 3989
[4] => 1940
[5] => 1242
)
[2] => Array (
[0] => june
[1] => july
[2] => august
[3] => september
[4] => october
[5] => november
)
)
I want to access only one of the arrays within the array at a time and echo them out.
For example, I would get: 510, 984, 1045, 2068, 1054, and 673 as one result.
I've looked at multiple threads and answers but nothing that quite solves my issue, I've been able to print out all the values but I just want some specifically.
I'd store it in the variable: $array_item
My most recent attempt was:
foreach ($array_item as $inner) {
if (is_array($inner)) {
foreach ($inner[0] as $value) {
echo "$value \n";
}
}
}
Which gives me: Warning: Invalid argument supplied for foreach().
I thought for sure that would work, what am I doing wrong?
510, it's$array_item[0][0]. If I want984, it's$array_item[0][1]. If I want1163, it's$array_item[1][0]. If I wantseptember, it's$array_item[2][3], etc.