Out out a specific array from a multy one?

$array = array (
      0 => 
        array (
          'id' => '9',
          'gallery_id' => '2',
          'picture' => '56475832.jpg'
        ),
      1 => 
        array (
          'id' => '8',
          'gallery_id' => '2',
          'picture' => '20083622.jpg'
        ),
      2 => 
        array (
          'id' => '7',
          'gallery_id' => '2',
          'picture' => '89001465.jpg'
        )
);

How do I get the entire array that has a key 1 in this multidimensional array?

I mean this:

1 => 
        array (
          'id' => '8',
          'gallery_id' => '2',
          'picture' => '20083622.jpg'
        )
$one = $array[1];

or

$one = array_slice($array, 1,1);

Thanks buddy! Do I have to put it in out outside the foreach?

PS. Thanks works great I was placing it in the foreach what’s why it wasn’t working.

Thanks

Sorry I have no idea what does foreach to do with your question

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.