'text/html; charset=utf-8', 'webp'=>'image/webp']; $type = $mime[strtolower(pathinfo($file, PATHINFO_EXTENSION))] ?? null; if ($type === null) { http_response_code(404); exit; } header('Content-Type: ' . $type); if ($_SERVER['REQUEST_METHOD'] === 'GET') { readfile($file); }