Getting part of text

I have a text fie http://feeds.michiganwxsystem.com/EC/CWTO/WWCN11.txt seen there. As you can see its a warning text file with all warnings in effect for Southern Ontario. I was wondering if there is a way to split that text up and just have the text for say…winter storm warning…or freezing rain warning…instead of having all 3 seen here. Any thoughts?

Thanks, Dave

you can use curl
[php]$ch = curl_init();
$timeout = 5; // set to zero for no timeout
curl_setopt ($ch, CURLOPT_URL, ‘http://feeds.michiganwxsystem.com/EC/CWTO/WWCN11.txt’);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
$file_contents = curl_exec($ch );
curl_close($ch );

$metar = substr($file_contents, 0, 40); // 21 is the number of characters after 0 to begin parsing
echo nl2br($metar) ;[/php]

Sponsor our Newsletter | Privacy Policy | Terms of Service