I am using a cURL request to get XML data, which works fine in the brower but returns text in the PHP cURL. I have looked at several similar questions here and tried the answers, with no luck. Here's the code.
$url = 'http://forecast.weather.gov/MapClick.phplat=38.4247341&lon=-86.9624086&FcstType=xml';
$agent = 'Myapp/v1.0 (http://example.org;webmaster@example.org)';
$rCURL = curl_init();
curl_setopt($rCURL, CURLOPT_URL, $url);
curl_setopt($rCURL, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($rCURL, CURLOPT_USERAGENT, $agent);
curl_setopt($rCURL, CURLOPT_HTTPHEADER, 'Content-Type: application/xml');
curl_setopt($rCURL, CURLOPT_BINARYTRANSFER, 1);
$aData = curl_exec($rCURL);
$error = curl_error($CURL);
curl_close($rCURL);
if ($error)
echo ($error);
else echo ($aData);