mardi 23 novembre 2010

récupérer la température extérieure en php

Grâce à Google en 3 lignes de php:

$xml_str = file_get_contents("http://www.google.com/ig/api?weather=antony");
$xml = new SimplexmlElement($xml_str, TRUE);
echo $xml->weather->current_conditions->temp_c['data'];

Aucun commentaire: