Problem when decoding json from oci compute instance list output in php
I use php and I want to decode the json output from the command oci compute instance list
.
In Powershell, This works fine to display the raw json:
php -r "var_dump(shell_exec('oci compute instance list --compartment-id ocid1.tenancy.oc1..removed'));"
But this returns NULL:
php -r "var_dump(json_decode(shell_exec('oci compute instance list --compartment-id ocid1.tenancy.oc1..removed')));"
If I strip off the "processor-description" field from the json output before decoding, it decodes successfully. So it appears there are problem characters within it causing this.
The contents of "processor-description" are:
"processor-description": "3.0 GHz Ampere® Altra™",
Tagged:
0