Jump to content

TrialByFire

New Members
  • Posts

    2
  • Joined

  • Last visited

TrialByFire's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thanks for the reply everyone, No basically I wanted to know how to actually declare the PHP object so json_encode() would return everything properly. What tripped me up was that there's an Array inside an Array inside of an Array and it made the actual declaration too confusing to write. So I broke it up into sub arrays and then declared the largest array by calling the smaller arrays. I have it working now, and I really appreciate the help!
  2. Hey PHP Homies! I'm trying to make this JSON into PHP so I can send it to an API using curl. I have no problem with the first part of it, but I'm getting totally zonked on the cart contents where the items are in their own object. { "store_id":"test", "api_token":"test", "checkout_id":"test", "txn_total":"4.00", "environment":"qa", "action":"preload", "cart":{ "items":[ { "description":"item 1", "unit_cost":"1.00", "quantity":"3" }, { "description":"item 2", "unit_cost":"1.00", "quantity":"1" } ], "subtotal":"4.00" } } What is the best way to represent something like this in PHP and then convert it to JSON format to send out to CURL? Thanks in advance!
×
×
  • 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.