I just want to read out the google weather api xml with that code but it returns a 500. Any ideas why?
<?php
$url = "http://www.google.com/ig/api?weather=Moskva&hl=en";
$xml = simplexml_load_string(utf8_encode(file_get_contents($url)));
echo $xml->weather->current_conditions->temp_c->attributes()->data;
?>
Separate the lines out and introduce a try / catch block as follows :
what happens then ?
Updated
Your response was due to the ip address your are coming from …. this was the response :
http://www.google.com/sorry/?continue=http://www.google.com/ig/api%3Fweather%3DMoskva%26hl%3Dentyping the response URL into a browser gives this :
Enter the URL in a browser and complete the CAPTCHA – should be sorted then