How to get a specific chunk of array from an array into an array?

Hi,

I have a big array from which I need a specific chunk extracted into a new empty array ?
How do i achieve that ?

Eg.

fruits
  -- apples
  -- mangoes
      -- big mango
      -- small mango
      -- green mango
  -- grapes
  -- banana

how to get mangoes out of fruits array into a new empty array so I am left with mangoes only ?

Thanks.

Hi Tapan,

The simplest way would be to do this:

$mangoes = $fruits['mangoes'];

Hi,

Did’nt reliase it was so easy to that. Works great.

Thanks :slight_smile: