Accessing array hierarchy

hi all

I have an array to interrogate using foreach; it contains two further arrays, the first one is called values and I can access it like this:

[php]foreach ($CustomGroup[‘values’] as $TopKey => $TopValue) {[/php]

The ‘values’ array itself contains multiple arrays called 0, 1, 2 etc and I access those with a second foreach structure:

$CGValues = $TopValue;
foreach($CGValues] as $CGKey => $CGValue){

My question is, can I get to the bottom level arrays directly without going through two separate foreach sructures?

Many thanks for any help :slight_smile:

I’m not sure I understand the question. Is array_values() an option?

Sponsor our Newsletter | Privacy Policy | Terms of Service