0) { foreach ($data as $item) { // Add each matching Tracker ID to the list $t = []; $t["DeviceID"] = $data["DeviceID"]; $trackerIDs[] = $t; } } // Return the results as JSON echo json_encode($trackerIDs); exit; } else { // Return an empty array if no tracker_id_last5 is provided echo json_encode([]); } ?>