HashTag007
HashTag007

Reputation: 33

how to access array like this?

    array (size=338)
   '6ada0377-c28b-4df2-adf5-02b813b3214e' => 
     array (size=2)
      'source_catagory' => string 'Exoclick' (length=8)
       'traffic_type' => string 'Adult Popunders - Chrome' (length=24)
   '6ada0377-c28b-http://www.myvidster.com/video/26933' => 
     array (size=2)
      'source_catagory' => string 'Exoclick' (length=8)
      'traffic_type' => string 'Adult Popunders - Chrome' (length=24)

I want to access source_category, I hope someone could be of help

Upvotes: 0

Views: 49

Answers (1)

Manh Nguyen
Manh Nguyen

Reputation: 940

There are many ways to get source_category key.

array_column($array, 'source_catagory');

OR

foreach ($array as $key => $value) {
    echo $value['source_catagory'] . '<br />';
}

DEMO

Upvotes: 2

Related Questions