How to format this php array?

How would I format the following into a php array?

{
  "merchant_ref": "Astonishing-Sale",
  "transaction_type": "authorize",
  "method": "credit_card",
  "amount": "1299",
  "currency_code": "USD",
  "credit_card": {
    "type": "visa",
    "cardholder_name": "John Smith",
    "card_number": "4788250000028291",
    "exp_date": "1020",
    "cvv": "123"
  }
}
$array = json_decode($thatthingyouhave);
$array = json_decode($thatthingyouhave, true);

(without the 2nd parameter you get stdClass objects instead of arrays)

1 Like

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