code to display weather feed based on city entered in textbox

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nagabhargavi
    New Member
    • May 2007
    • 1

    #1

    code to display weather feed based on city entered in textbox

    Hi,
    Can any one tell me how to display weather of a city enetred using text box in my web site using php like as in weather.com.
  • pbmods
    Recognized Expert Expert
    • Apr 2007
    • 5821

    #2
    You could load an RSS feed from Yahoo!:
    [code=php]
    $weather = file_get_conten ts("'feed://xml.weather.yah oo.com/forecastrss?p=' . urlencode($_GET['zip']));
    [/code]

    You could then use XML_RSS, or you could parse the output by hand if you wish.

    Comment

    Working...