I'm checking an array if it contains a few things and an array inside it is empty. How do I achieve this?
I've tried checking it on empty, inArray and a regular condition in the if.
Screenshot of the array (assignedTo, which needs to be null/empty in order for the if to be true):
for($i = 1; $i < $this->pages['maxPages']+1; $i++) {
$response = $this->client->get('v1/tickets/search.json', [
'query' => ['page' => $i, 'assignedTo[]' => null, 'statuses[]' => 'active', 'waiting', 'sortDir' => 'desc', 'sortBy' => 'updatedAt']
]);
//Verwekt de data gekregen van de API
$json = (string)$response->getBody()->getContents();
$decoded = json_decode($json, true);
//Haalt de lengte van de result array op
$arrayLength = sizeof($decoded['tickets']);
//Slaat de resultaten op in de bijbehorende variabele. De if statement loopt nog na of de tickets écht aan de filters voldoen. Het komt nog wel eens voor dat er tickets worden opgehaald die niet opgehaald moeten worden volgens de filters.
for($int = 0; $int < $arrayLength; $int++) {
if($decoded['tickets'][$int]['status'] === 'active' || $decoded['tickets'][$int]['status'] === 'waiting on customer' && empty($decoded['tickets'][$int]['assignedTo'])) {
$newticketamount++;
$activetickets[] = $decoded['tickets'][$int];
}
}
}
So, I want the if to be executed when the $decoded['tickets'][$int]['assignedTo'] is empty. Currently it has both the tickets that ARE assigned and the ones that aren't.

isset. But anyway I think the solution has already been provided down here.