tags:

views:

14

answers:

1

hello, i am using this code to get an file

$url="http://zz.com/a"
     $ch = curl_init();
    $timeout = 5;
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
    echo $xml = curl_exec($ch);

it will be an xml file and i need to display it as xml if i display it is like an string i need to display it as an xml file

+3  A: 

Before echo (and any other output), add:

header('Content-Type: application/xml');
Lekensteyn