str_replace(["\t", "\n", "\r"], ' ', (string)$f); $dir = dirname($root) . '/ai-hits'; if (!is_dir($dir)) @mkdir($dir, 0755, true); $day = (new DateTimeImmutable('now', new DateTimeZone('America/Chicago')))->format('Y-m-d'); @file_put_contents($dir . '/ai-hits-' . $day . '.tsv', implode("\t", array_map($clean, [gmdate('c'), $kind, $who, $req, $ref, substr($ua, 0, 200)])) . "\n", FILE_APPEND | LOCK_EX); if (!$ok) { http_response_code(404); if (is_file($root . '/404.html')) readfile($root . '/404.html'); exit; } header('Content-Type: text/html; charset=utf-8'); readfile($real);