All pastes #667683 Raw Edit

Miscellany

public php v1 · immutable
#667683 ·published 2007-08-23 07:10 UTC
rendered paste body
preg_match('/<s>(.+)<\/s>/',$page, $windz);    if(preg_match_all('/<\/d>\s*<t>(.+)<\/t>\s*<\/wind>/s',$page, $windd)) {	$winddir = strtoupper($windd[1][0]);	$abbrs = array (	 'N'   => 'North',	 'S'   => 'South',	 'E'   => 'East',	 'W'   => 'West',	 'SW'  => 'Southwest',	 'SE'  => 'Southeast',	 'NW'  => 'Northwest',	 'NE'  => 'Northeast',	 'SSW' => 'South-Southwest',	 'SSE' => 'South-Southeast',	 'NNW' => 'North-Northwest',	 'NNE' => 'North-Northeast',	 'WNW' => 'West-Northwest',	 'WSW' => 'West-Southwest',	 'ENE' => 'East-Northeast',	 'ESE' => 'East-Southeast',	 );	 	 $winddir = ( !empty($abbrs[$winddir]) ? $abbrs[$winddir] : $winddir );	 	 if($windz[1] != 'calm') { $wind = "$winddir at $windz[1] MPH"; }	 else { $wind = 'calm'; }	 }	     preg_match('/<hmid>(.+)<\/hmid>/',$page, $hmid);	preg_match('/<ud>.<i>(.+)<\/i>.<t>(.+)<\/t>.<\/uv>/',$page, $uv);	preg_match('/<r>(.+)<\/r>/',$page, $r);	preg_match('/<d>(.+)<\/d>/',$page, $d);	if($uv[1] > 2) { $uvi = ", UV Index: $uv[1] ($uv[2])"; }	else { unset($uv); }