Hello,
Having a bit of a tough time understanding what is going on in my brain!
I'm basically pulling some data from an API using CuRL, which is working fine. The structure of the data is:
[data][tickets] - tickets being an array of support tickets in the system, which then contains ticketNumber, title, content. I want to display these values in a list, I have this code currently:
if ($err) {
echo "cURL Error #:" . $err;
} else {
$return = json_decode($response, true);
foreach($return as $key) {
echo $key["tickets"][1]['ticketNumber']." - ";
echo $key["tickets"][1]['title']." - ";
echo $key["tickets"][1]['content'];
}
}
Which obviously returns the ticketNumber, title & content of the first support ticket in the array, but I want to loop through and display that information for each ticket!
Can anyone advise as to where I am going wrong? I think I need to utilise the ["tickets"][x] but not sure how!
Thanks in advance!
Steve