(.*)|', $html, $headers); $warnheaders = $headers[1]; //Get the advisory text and put them into an array as well preg_match_all('|
(.*)
|Uis', $html, $headers); $warntext = $headers[1]; //If there is more than one advisory, we need to set its priority if (count($warnheaders) >= 1) { $i = 0; $flag = 0; //First, around here tornados are the biggest danger. A warning is critical information. //Display this one first no matter what! while ($i < count($warnheaders)): if (preg_match("/Tornado Warning/i", $warnheaders[$i])) { $targetwarn = $warnheaders[$i]; $targettext = $warntext[$i]; $targettext = explode("$$",$targettext); $flag = 1; break; } $i++; endwhile; //Next if there are none of the above found. Display the first warning message. if ($flag == 0) { $i = 0; while ($i < count($warnheaders)): if (preg_match("/Warning/i", $warnheaders[$i])) { $targetwarn = $warnheaders[$i]; $targettext = $warntext[$i]; $targettext = explode("$$",$targettext); $flag = 1; break; } $i++; endwhile; } //Next if there are none of the above found. Display the first watch message. if ($flag == 0) { $i = 0; while ($i < count($warnheaders)): if (preg_match("/Watch/i", $warnheaders[$i])) { $targetwarn = $warnheaders[$i]; $targettext = $warntext[$i]; $targettext = explode("$$",$targettext); $flag = 1; break; } $i++; endwhile; } //Next if there are none of the above found. Display the first advisory message. if ($flag == 0) { $i = 0; while ($i < count($warnheaders)): if (preg_match("/Advisory/i", $warnheaders[$i])) { $targetwarn = $warnheaders[$i]; $targettext = $warntext[$i]; $targettext = explode("$$",$targettext); $flag = 1; break; } $i++; endwhile; } //Next if there are none of the above found. Display the first statement message. if ($flag == 0) { $i = 0; while ($i < count($warnheaders)): if (preg_match("/Statement/i", $warnheaders[$i])) { $targetwarn = $warnheaders[$i]; $targettext = $warntext[$i]; $targettext = explode("$$",$targettext); $flag = 1; break; } $i++; endwhile; } //Next if none of the above is found Check for air quality alert if ($flag == 0) { $i = 0; while ($i < count($warnheaders)): if (preg_match("/Air Quality Alert/i", $warnheaders[$i])) { $targetwarn = $warnheaders[$i]; $targettext = $warntext[$i]; $targettext = explode("$$",$targettext); $flag = 1; break; } $i++; endwhile; } //Next if there are none of the above found. Set the advisory to default message. if ($targetwarn == "No Active Hazardous Weather Conditions Found") { $targetwarn = "NO CURRENT ADVISORIES"; $targettext[0] = "THERE ARE NO ACTIVE WATCHES, WARNINGS OR ADVISORIES FOR THE HIGH SHOALS AREA"; } else if (empty($targetwarn)) { $targetwarn = "NO CURRENT ADVISORIES"; $targettext[0] = "THERE ARE NO ACTIVE WATCHES, WARNINGS OR ADVISORIES FOR THE HIGH SHOALS AREA"; } else if ($targetwarn == "Short Term Forecast") { $targetwarn = "NO CURRENT ADVISORIES"; $targettext[0] = "THERE ARE NO ACTIVE WATCHES, WARNINGS OR ADVISORIES FOR THE HIGH SHOALS AREA"; } if ($targetwarn <> "NO CURRENT ADVISORIES") { $warnlist = 'ALL CURRENT ADVISORIES:'; for ($i = 0; $i <= count($warnheaders); $i++) { $warnheaderplus = preg_replace( '| |', '+', $warnheaders[$i] ); $warnlist = $warnlist . '
' . $warnheaders[$i] . ''; } } } ?>
Welcome to Weather Nut Haven.com
08/20/14 08:09 AM
   Haze\clear
70° F Feels Like 69°
Temp Rate tempchangelasthourfaren% °F
Humidity 93%
Barometer 29.98 in.
Dew Point 67.0°F
Wind 0.0 mph   ENE
Rain Today 0.01 in.
set_feed_url('http://www.nhc.noaa.gov/index-at.xml'); // Set which feed to process. // Run SimplePie. $feed->init(); // This makes sure that the content is sent to the browser as text/html and the UTF-8 character set (since we didn't change it). $feed->handle_content_type(); // Let's begin our XHTML webpage code. The DOCTYPE is supposed to be the very first thing, so we'll keep it on the same line as the closing-PHP tag. ?>

get_title(); ?>

get_description(); ?>

get_items() as $item): ?>

get_title(); ?>

get_description(); ?>

Posted on get_date('j F Y | g:i a'); ?>