"deals": [
{
"soldQuantity": 1000,
"shippingAddressRequired": false,
"options": [
{
"value": {
"formattedAmount": "$43.78",
"currencyCode": "USD",
"amount": 4378
},
},
],
},
]
I want to parse formattedAmount and currencyCode using php foreach loop
my code gives error :-Trying to get property of non-object
the code is
$json = file_get_contents('../jsonfile/product.json');
$json_string = json_decode($json);
foreach($json_string->deals as $mydata)
{
foreach($mydata->options->value as $option)
{
echo $option->;
}
}