I need some help with parsing and looking through JSON result with PHP. Within the example result below, I need to check against the categories of the technology.
The outcome I would expect is that if the category analytics has been found, to flag this with a true variable, and also to set the variable with the name of the analytics, for example "google analytics"
This is the example code
foreach ($resp['technologies'] as $item) {
if ($item['categories'][0] === 'analytics') {
$found = true;
$analyticsis= $item['name'];
This is the example JSON we are looking through.
[{
"url": "https://www.websiteexample.co.uk",
"technologies": [{
"slug": "google-analytics",
"name": "Google Analytics",
"versions": [],
"trafficRank": 0,
"categories": [{
"id": 10,
"slug": "analytics",
"name": "Analytics"
},
{
"id": 61,
"slug": "saas",
"name": "SaaS"
}
]
}