'text/css', 'js' => 'application/javascript', 'html' => 'text/html', 'svg' => 'image/svg+xml', 'png' => 'image/png', 'jpg' => 'image/jpeg', 'json' => 'application/json', ]; if (isset($types[$ext])) header('Content-Type: ' . $types[$ext]); readfile($real_file);