Skip to content

Instantly share code, notes, and snippets.

@dwedwards
dwedwards / Index.php
Created June 26, 2013 21:25 — forked from joshhartman/gist:2271523
Weather yahoo api with php
<?php
if(isset($_POST['zipcode']) && is_numeric($_POST['zipcode'])){
$zipcode = $_POST['zipcode'];
}else{
$zipcode = '50644';
}
$result = file_get_contents('http://weather.yahooapis.com/forecastrss?p=' . $zipcode . '&u=f');
$xml = simplexml_load_string($result);
//echo htmlspecialchars($result, ENT_QUOTES, 'UTF-8');