Here ya go...
These are the Eight routines that pull the data the page
//Finds USA High Heat Index
preg_match_all('|<div id="heatIndex"[^>]*>(.*)</div>|Uis', $html2, $matches);
// print "<pre>\n".print_r($matches,true)."</pre>\n";
if(isset($matches[1][0])) {
$heatIndextable = $matches[1][0];
preg_match_all('|<td>(.*)</td>|Uis',$heatIndextable,$matches);
// print "<pre>\n".print_r($matches,true)."</pre>\n";
$usaheatIndex = trim(preg_replace("|\n|is",'',strip_tags($matches[1][2]).' <br/>'.strip_tags($matches[1][0])));
print "<!-- usaheatIndex='$usaheatIndex' -->\n";
} else {
$usaheatIndex = 'N/A';
}
//Finds USA High Wind Chill
preg_match_all('|<div id="windChill"[^>]*>(.*)</div>|Uis', $html2, $matches);
// print "<pre>\n".print_r($matches,true)."</pre>\n";
if(isset($matches[1][0])) {
$windChilltable = $matches[1][0];
preg_match_all('|<td>(.*)</td>|Uis',$windChilltable,$matches);
// print "<pre>\n".print_r($matches,true)."</pre>\n";
$usawindChill = trim(preg_replace("|\n|is",'',strip_tags($matches[1][2]).' <br/>'.strip_tags($matches[1][0])));
print "<!-- usawindChill='$usawindChill' -->\n";
} else {
$usawindChill = 'N/A';
}
//Finds USA High Wind
preg_match_all('|<div id="wind"[^>]*>(.*)</div>|Uis', $html2, $matches);
// print "<pre>\n".print_r($matches,true)."</pre>\n";
if(isset($matches[1][0])) {
$windtable = $matches[1][0];
preg_match_all('|<td>(.*)</td>|Uis',$windtable,$matches);
// print "<pre>\n".print_r($matches,true)."</pre>\n";
$usawind = trim(preg_replace("|\n|is",'',strip_tags($matches[1][2]).' <br/>'.strip_tags($matches[1][0])));
print "<!-- usawind='$usawind' -->\n";
} else {
$usawind = 'N/A';
}
//Finds USA High
preg_match_all('|<div id="highTemp"[^>]*>(.*)</div>|Uis', $html2, $matches);
// print "<pre>\n".print_r($matches,true)."</pre>\n";
if(isset($matches[1][0])) {
$hightable = $matches[1][0];
preg_match_all('|<td>(.*)</td>|Uis',$hightable,$matches);
// print "<pre>\n".print_r($matches,true)."</pre>\n";
$usahigh = trim(preg_replace("|\n|is",'',strip_tags($matches[1][2]).' <br/>'.strip_tags($matches[1][0])));
print "<!-- usahigh='$usahigh' -->\n";
} else {
$usahigh = 'N/A';
}
//Finds USA Low
preg_match_all('|<div id="lowTemp"[^>]*>(.*)</div>|Uis', $html2, $matches);
// print "<pre>\n".print_r($matches,true)."</pre>\n";
if(isset($matches[1][0])) {
$lowtable = $matches[1][0];
preg_match_all('|<td>(.*)</td>|Uis',$lowtable,$matches);
//print "<pre>\n".print_r($matches,true)."</pre>\n";
$usalow = trim(preg_replace("|\n|is",'',strip_tags($matches[1][2]).'<br/>'.strip_tags($matches[1][0])));
print "<!-- usalow='$usalow'-->\n";
} else {
$usalow = 'N/A';
}
//Finds USA High Precip
preg_match_all('|<div id="precip"[^>]*>(.*)</div>|Uis', $html2, $matches);
//print "<pre>\n".print_r($matches,true)."</pre>\n";
if(isset($matches[1][0])) {
$raintable = $matches[1][0];
preg_match_all('|<td>(.*)</td>|Uis',$raintable,$matches);
// print "<pre>\n".print_r($matches,true)."</pre>\n";
$usaprecip = trim(preg_replace("|\n|is",'',strip_tags($matches[1][2]).'<br/>'.strip_tags($matches[1][0])));
print "<!-- usaprecip='$usaprecip' -->\n";
} else {
$usaprecip = 'N/A';
}
//Finds World High
preg_match_all('|<div id="worldHighTemp"[^>]*>(.*)</div>|Uis', $html2, $matches);
// print "<pre>\n".print_r($matches,true)."</pre>\n";
if(isset($matches[1][0])) {
$Whightable = $matches[1][0];
preg_match_all('|<td>(.*)</td>|Uis',$Whightable,$matches);
//print "<pre>\n".print_r($matches,true)."</pre>\n";
$worldhigh = trim(preg_replace("|\n|is",'',strip_tags($matches[1][2]).'<br/>'.strip_tags($matches[1][0])));
print "<!-- worldhigh='$worldhigh'-->\n";
} else {
$worldhigh = 'N/A';
}
//Finds World Low
preg_match_all('|<div id="worldLowTemp"[^>]*>(.*)</div>|Uis', $html2, $matches);
// print "<pre>\n".print_r($matches,true)."</pre>\n";
if(isset($matches[1][0])) {
$Wlowtable = $matches[1][0];
preg_match_all('|<td>(.*)</td>|Uis',$Wlowtable,$matches);
//print "<pre>\n".print_r($matches,true)."</pre>\n";
$worldlow = trim(preg_replace("|\n|is",'',strip_tags($matches[1][2]).'<br/>'.strip_tags($matches[1][0])));
print "<!-- worldlow='$worldlow'-->\n";
} else {
$worldlow = 'N/A';
}
Then these are the Eight 'echo' statements you need in your page where you place them
High Temperature= <?php echo $usahigh ?>
High Heat Index= <?php echo $usaheatIndex ?>
Low Temperature= <?php echo $usalow ?>
Lowest Wind Chill= <?php echo $usawindChill ?>
High Wind Gust= <?php echo $usawind ?>
Rainfall= <?php echo $usaprecip ?>
World High Temp= <?php echo $worldhigh ?>
World Low Temp= <?php echo $worldlow ?>
If you have any problems, post your code that you use in your sidebar for the extremes, most likely a table?
Brad
*edit* this does not include Pats Mt. Washington changes so don't change the High Wind Gust if you've already added his routine.