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.