false, 'message' => 'No blocklist files found.' ]); exit; } $allEntries = []; foreach ($blocklistFiles as $file) { $content = file_get_contents($file); if ($content === false) { // Skip file if reading fails, optionally log the error continue; } $data = json_decode($content, true); if (!is_array($data)) { // Skip invalid JSON files continue; } // Append all entries from this file $allEntries = array_merge($allEntries, $data); } // Output the aggregated blocklist entries as JSON echo json_encode([ 'success' => true, 'entries' => $allEntries ]);