<html>
<head>
</head>
<body>
<pre>
<?php

 $time 
time();
 
$timeElapsed = ($time filemtime("temp.txt"));
 if(
$timeElapsed 900){
      
$xmlBuffer file_get_contents("http://www.nws.noaa.gov/data/current_obs/KEWR.xml");
      
$bgn strpos($xmlBuffer"<temperature_string>") + strlen("<temperature_string>");
      
$end strpos($xmlBuffer"</temperature_string>");
      
$temperature substr($xmlBuffer,$bgn,$end-$bgn);
      
$f fopen("temp.txt","w");
      
fwrite($f$temperature);
      
fclose($f);
 }
 else 
$temperature file_get_contents("temp.txt");
 

echo 
"<h1>$temperature</h1>";


?>