Hi,
here is a code that will read this file and print out all the dates in it. You can go ahead and make it do whatever you want instead of printing the dates. I assume you are trying to format this TXT into a nice weather data displayed on your page, right? So, the array $lines holds the info in the file line by line.
<?php
$url = "ftp://iwin.nws.noaa.gov/data/text/WUUS54/KLCH.TXT";
$fd = fopen($url, "r");
//I'm assuming the file won't be bigger than 10kb
$contents = fread($fd, 10240);
fclose($fd);
// put into array by lines
$lines = explode("\n", $contents);
print sizeof($lines) . "<BR>";
//look for dates
for($i = 0; $i < sizeof($lines); $i++) {
$resarray = "";
if(preg_match("/([0-9]{3,4}) (AM|PM) ([A-Z]{3})/", $lines[$i], $resarray)) {
print $resarray[0] . "<br>";
}
}
//print $contents;
?>
If you need help in formatting the contents (as held by $contents) a certain way, describe in detail how you want to display it, and I'll write you a code.
hope this gets you a start!
-sridhar