I'm trying to use an API which in JSON and interpret the data in PHP. I can output the all of the data using this below. But I can't seem to find a way to decode the data and then extract what I would like.
$url = "https://home-api.letmc.com/v2/tier3/.......";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Content-Type: application/json'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$output = curl_exec($ch);
curl_close($ch);
$data = $output;
This is the output of the API before using the above.
{
"Data": [
{
"OID": "060a-06fd-1176-7964",
}
],
"Count": 1
}
Is there an easy way for me to using my PHP I have so far, just echo the OID from the API without everything else showing?