-1

I've got a JSON object in the following format:

[
{
    "variantId": 39324063400023,
    "variantTitle": "5 \/ Medium",
    "inventory_item_id": 41418131275863
},
{
    "variantId": 39324063432791,
    "variantTitle": "5.5 \/ Medium",
    "inventory_item_id": 41418131308631
},
{
    "variantId": 39324063465559,
    "variantTitle": "6 \/ Medium",
    "inventory_item_id": 41418131341399
}
]

When I try and loop through it with the following code I get the error "Invalid argument supplied for foreach()"

foreach($variantObject as $var){///}

I know there is an issue with the JSON formatting, what do I need to do to fix it?

Daelan
  • 683
  • 4
  • 11
  • 22

0 Answers0