Forums > Php
> Simple way to access weather forecast from yahoo api
benaya
Posted on Feb 19, 2009
Join Date: June 2007
Location: India ( Chennai )
Posts: 90
Simple way to access weather forecast from yahoo api
<?php // Accessing yahoo weather api for chennai weather if($objXml = simplexml_load_file(`http://weather.yahooapis.com/forecastrss?p=INXX0202&u=c`)) {
// Getting description which display image, conditions and forecast $arry = split("<br />",str_replace("<BR />","<br />",$objXml->channel->item->description));
// Embeding title and description $strString = $objXml->channel->item->title."<br />".$arry[0]."<br />".$arry[1]."<br />".$arry[2]."<br />".$arry[3]; echo $strString; } ?>
Find rss for your country with below link http://weather.yahoo.com/