Current Weather in 3 lines of PHP


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. <?php
  2. $xml = simplexml_load_file('http://www.google.com/ig/api?weather=ADDRESS');
  3. $information = $xml->xpath("/xml_api_reply/weather/current_conditions/condition");
  4. echo $information[0]->attributes();
  5. ?>

URL: http://ortanotes.tumblr.com/post/200469319/current-weather-in-3-lines-of-php

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.