$value) { if (strtolower($key) != 'host' && strtolower($key) != 'content-length') { $headers[] = "$key: $value"; } } curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); // Execute the request and get the response $response = curl_exec($ch); // Check for cURL errors if ($response === false) { http_response_code(500); // Internal Server Error echo 'Error: ' . curl_error($ch); curl_close($ch); exit(); } // Get the HTTP response code $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); // Close the cURL session curl_close($ch); // Set the response code http_response_code($httpCode); // Output the response echo $response; ?>