{'totalCount'} !== 1) { header('Status: 404'); header('Content-Length: 0'); exit; } header('Status: 303'); header('Location: ./' . $json->{'data'}[0]->{'db'} . ':' . $json->{'data'}[0]->{'id'}); exit; } $refDate = $_GET['referenceDate'] ?? null; if ($refDate !== null) { $refDate = explode('-', $refDate); $refDate = $refDate[2] . '.' . $refDate[1] . '.' . $refDate[0]; } $url = "https://www.easy-cert.com/htm/suchresultat-detail.htm?sprache=de&db=" . urlencode($parts[0]) . "&id=" . urlencode(str_replace('-', '_', $parts[1])) . "&historyDate=" . urlencode($refDate); $s = curl_init($url); curl_setopt($s, CURLOPT_RETURNTRANSFER, true); if (($html = curl_exec($s)) === false) { header('Status: 500'); header('Content-Length: 0'); exit; } $html = preg_replace('//s', ' ', $html); preg_match_all('@