get specific data using php in nested array in json -


so have json , need specific items e.g. promotions:

{     "currency": "usd",     "code": 200,     "sales_list": [                     {                         "date": "2012-05-21",                         "country": "jp",                          units:{                                app: {                                              downloads: 10,                                              updates: 1,                                },                                iap: {                                              sales: 3,                                              refunds: 5,                                              promotions:1                                },                          },                          revenue: {                                  app: {                                              downloads “100.98”,                                              refunds: “-10.00”,                                              promotions: “1.00”                                  },                                  iap: {                                              sales: “30.00”,                                              refunds: “-1.00”,                                  },                                  ad: "1000.00"                              },               }], “iap_sales”:[               {                   "date": "2012-05-21",                   "country": "jp",                   “iap”:  “com.iap1”,                    units:{                           sales: 3,                           refunds: 5,                    },                    revenue: {                              sales: "30.09",                              refunds: "1.21",                    },                }],     "page_index": 1, } 

how promotions?

i tried use this:

    $json_data = connect(t_url);      $data = json_decode($json_data);      return $data->sales_list[0]->units[0]->app[0]->promotions; 

but effective/ efficient?

also im having hard time getting data appannie. authorization problem or bad request. if bad request means im in though right?

i use terminal test curl , url like:

curl --basic --user email : password "http:/www.appannie.com/v1/accounts/acntnum/..." 

they suggested since have authentication. there time bad request think im in unlike unauthorized access error.

they suggest other forms authethication should basic+base 64 of ur eadd , password. don't know use it.

any suggestions convert php curl request?


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -