Quantcast
Viewing all articles
Browse latest Browse all 11091

Ryan | Add to Cart Apps commented on Extracting JSON file using PHP

Try using the following for an object

print_r(json_decode($orders));

or for an associative array

print_r(json_decode($orders, true));

if you assign it to a variable such as

$orderDetails = json_decode($orders, true);

you would be able to access the id with

print_r($orderDetails['order']['id']);

The above is all untested using your code but should work as expected.


Viewing all articles
Browse latest Browse all 11091

Trending Articles