I am currently struggeling to only display a certain part of a JSON object array in php.
My code looks like this:
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, '...correct-link-here...');
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Authorization: Token token=...api-key-here...',
'Accept: application/vnd.api+json'
));
$output = curl_exec($ch);
$data = json_decode($output, true);
curl_close($ch);
?>
The result is something like this (short version below):
{
"data": {
"id": "awesome-conf",
"type": "events",
"attributes": {
"banner-url": null,
"currency": "USD",
"description": "",
"end-date": null,
"live": false,
"location": null,
"logo-url": null,
"private": false,
"slug": null,
"start-date": null,
"title": null
},
"links": {
"self": "https://api.tito.io/v2/an-account/awesome-conf"
},
"relationships": {
"releases": {
"links": {
"related": "https://api.tito.io/v2/an-account/awesome-conf/releases"
}
}
}
}
}
I only want the id, logo-url, start-date and title to be displayed. Does somebody know how that could work? I couldn't find anything that worked on the internet for me.
Thank you very much! - Isabel