Ich möchte die folgende XML date als string in PHP erhalten:
http://armory.worldofwarcraft.com/character-sheet.xml?r=Hyjal&n=Funkadin
Wenn ich die seite inforefox lade und den Quelltext ansehe, so sehe ich die XML datei.
Lade ich die Datei wie im untered Script kriege ich immer die HTML gerenderte version :-/
Irgendwelche tips?
$fp = fsockopen('armory.worldofwarcraft.com', 80, &$errno, &$errstr, 8);
if (!$fp) {
return "N/A";
}
else {
echo "no error";
$request = "GET /character-sheet.xml?r=Hyjal&n=Funkadin HTTP/1.1\r\n"
."Host: armory.worldofwarcraft.com\r\n"
."Connection: close\r\n\r\n";
fputs($fp, $request);
$response = "";
while (!feof($fp)) {
echo fgets($fp, 128);
}
fclose($fp);
return $response;
// N/A means, this User set the Option, his Online
// Status cannot be shown over the Internet
return FALSE;
}