Weather.com Widget for PHP
The following is a quick little weather widget that pulls an RSS feed from Weather.com. It replace with the zipcode of your choice to find the weather report in your area.
$xmlfile = 'http://rss.weather.com/weather/rss/local/45014?cm_ven=LWO&cm_cat=rss&par=LWO_rss'; $xmlparser = xml_parser_create(); // open a file and read data $fp = fopen($xmlfile, 'r'); $xmldata = fread($fp, 4096); xml_parse_into_struct($xmlparser,$xmldata,$values); xml_parser_free($xmlparser); echo($values[52]['value']).'
'; $output = $values[58]['value']; echo(substr($output,0,-18).'
');