Jump to content

AndyGB

New Members
  • Posts

    2
  • Joined

  • Last visited

AndyGB's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi I am converting a JSON object into an array and displaying like so: $json = json_decode($json); print_r($json); The results of which are: stdClass Object ( [orders] => Array ( [0] => stdClass Object ( [id] => 1429118021 [email] => test@mailinator.com [closed_at] => [created_at] => 2015-10-06T18:31:45+01:00 [updated_at] => 2015-10-06T18:31:45+01:00 [number] => 2 [note] => [token] => 6c92c7c6a6fd812eb9dfc4c8b2e2517b [gateway] => Bank Deposit [test] => [total_price] => 39.94 [subtotal_price] => 31.94 [total_weight] => 357 [total_tax] => 5.32 [taxes_included] => 1 [currency] => GBP [financial_status] => pending [confirmed] => 1 [total_discounts] => 0.00 [total_line_items_price] => 31.94 [cart_token] => db1e1fc102f3a3ae565feebf5793bfdc [buyer_accepts_marketing] => [name] => #1002 [referring_site] => http://sebi024.myshopify.com/ [landing_site] => /collections/all [cancelled_at] => [cancel_reason] => [total_price_usd] => 60.52 [checkout_token] => 06a996b75a8cb03819096c93cd2a2d63 [reference] => What I am basically trying to do is get the values, such as the ID number, which I was hoping to do like this: $json['orders'][0]['id'] Clearly that was too easy :/ I am guessing I can't do that because these are objects within arrays within objects?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.