Confused with foreach and multidimensional array - PHP
Ok, so arrays are my weakness and I'm struggling with this. It's probably dead simple too. Basically, I have an array which is

Code:

        Array
        (
    [data] => Array
        (
            [0] => Array
                (
                    [name] => getalbum
                    [fql_result_set] => Array
                        (
                            [0] => Array
                                (
                                    [aid] => 187046464639937_101906
                                    [name] => photo tab
                                    [cover_pid] => 187046464639937_1661168
                                )

                            [1] => Array
                                (
                                    [aid] => 187046464639937_99627
                                    [name] => Cover Photos
                                    [cover_pid] => 187046464639937_1661054
                                )

                        )

                )

            [1] => Array
                (
                    [name] => getcover
                    [fql_result_set] => Array
                        (
                            [0] => Array
                                (
                                    [src] => http://photos-g.ak.fbcdn.net/hphotos-ak-prn1/526499_403098366368078_187046464639937_1661168_217706037_s.jpg
                                )

                            [1] => Array
                                (
                                    [src] => http://photos-b.ak.fbcdn.net/hphotos-ak-ash3/562470_403049039706344_187046464639937_1661054_361917190_s.jpg
                                )

                        )

                )

        )

        )

I'm using a foreach to call the array by using
PHP Code:

         foreach($fql_query_obj['data'] as $albums){
    foreach($albums['fql_result_set'] as $album){
        //print_r($album);
         if(($album['name'] != "Wall Photos") && ($album['name'] != "Cover Photos") && ($album['name'] != "photo tab")){
             echo $album['name'].' :: '.$album['aid'];
    
                
                     echo '<img src="'.$album['src'].'" /><br />';
    
         }    
     }
          } 
Now it seems to go through the getalbum array then the getcover. How can I do it so it merges both of them together? 
Confused with foreach and multidimensional array - PHP
===

Ok, so arrays are my weakness and I'm struggling with this. It's probably dead simple too. Basically, I have an array which is

Code:

        Array
        (
    [data] => Array
        (
            [0] => Array
                (
                    [name] => getalbum
                    [fql_result_set] => Array
                        (
                            [0] => Array
                                (
                                    [aid] => 187046464639937_101906
                                    [name] => photo tab
                                    [cover_pid] => 187046464639937_1661168
                                )

                            [1] => Array
                                (
                                    [aid] => 187046464639937_99627
                                    [name] => Cover Photos
                                    [cover_pid] => 187046464639937_1661054
                                )

                        )

                )

            [1] => Array
                (
                    [name] => getcover
                    [fql_result_set] => Array
                        (
                            [0] => Array
                                (
                                    [src] => http://photos-g.ak.fbcdn.net/hphotos-ak-prn1/526499_403098366368078_187046464639937_1661168_217706037_s.jpg
                                )

                            [1] => Array
                                (
                                    [src] => http://photos-b.ak.fbcdn.net/hphotos-ak-ash3/562470_403049039706344_187046464639937_1661054_361917190_s.jpg
                                )

                        )

                )

        )

        )

I'm using a foreach to call the array by using
PHP Code:

         foreach($fql_query_obj['data'] as $albums){
    foreach($albums['fql_result_set'] as $album){
        //print_r($album);
         if(($album['name'] != "Wall Photos") && ($album['name'] != "Cover Photos") && ($album['name'] != "photo tab")){
             echo $album['name'].' :: '.$album['aid'];
    
                
                     echo '<img src="'.$album['src'].'" /><br />';
    
         }    
     }
          } 
Now it seems to go through the getalbum array then the getcover. How can I do it so it merges both of them together? 