All pastes #667656 Raw Edit

Miscellany

public php v1 · immutable
#667656 ·published 2007-08-23 06:21 UTC
rendered paste body
preg_match('/<s>(.+)<\/s>/',$page, $windz);    if(preg_match_all('/<\/d>\s*<t>(.+)<\/t>\s*<\/wind>/s',$page, $windd)) {	$winddir = $windd[2];	print_r("$windd\n");	 switch($winddir) {	 CASE 'N':	 return 'North';	 CASE 'S':	 return 'South';	 CASE 'E':	 return 'East';	 CASE 'W':	 return 'West';	 CASE 'SW':	 return 'Southwest';	 CASE 'SE':	 return 'Southeast';	 CASE 'NW':	 return 'Northwest';	 CASE 'NE':	 return 'Northeast';	 CASE 'SSW':	 return 'South-Southwest';	 CASE 'SSE':	 return 'South-Southeast';	 CASE 'NNW':	 return 'North-Northwest';	 CASE 'NNE':	 return 'North-Northeast';	 CASE 'WNW':	 return 'West-Northwest';	 CASE 'WSW':	 return 'West-Southwest';	 CASE 'ENE':	 return 'East-Northeast';	 CASE 'ESE':	 return 'East-Southeast';	 }	 if($windz[1] != 'calm') { $wind = "$winddir at $windz[1] MPH"; }	 else { $wind = 'calm'; }	 }