Jump to content

ERuiz

Members
  • Posts

    83
  • Joined

  • Last visited

    Never

Contact Methods

  • Website URL
    http://www.virtualaa.com

Profile Information

  • Gender
    Not Telling

ERuiz's Achievements

Member

Member (2/5)

0

Reputation

  1. Worked perfectly, thanks!
  2. Well, I THOUGHT I had it fixed! I need help again guys... function get_taf($station) { $fileName = "ftp://tgftp.nws.noaa.gov/data/forecasts/taf/stations/$station.TXT"; $taf = ''; $fileData = @file($fileName); if ($fileData != false) { list($i, $date) = each($fileData); while (list($i, $line) = each($fileData)) { $taf .= ' ' . trim($line); } $taf = trim(str_replace(' ', ' ', $taf)); } return $taf; } How can I have this script return "NO DATA AVAILABLE" to $taf, if the file is not found on the server?
  3. *SLAPS HEAD*! Nevermind guys, I fixed it.
  4. Hello guys and gals, I have a small problem. The following script: <?php function get_metar($station) { $fileName = "ftp://tgftp.nws.noaa.gov/data/observations/metar/stations/$station.TXT"; $metar = ''; $fileData = @file($fileName); // or die('Data not available'); if ($fileData != false) { list($i, $date) = each($fileData); while (list($i, $line) = each($fileData)) { $metar .= ' ' . trim($line); } $metar = trim(str_replace(' ', ' ', $metar)); } return $metar; } $dep_station = "KMIA"; $dep_metar = get_metar($dep_station); echo $dep_metar; ?> fetches the file and displays it. The file's contents is this format: 2007/11/01 04:56 TJSJ 010456Z 10007KT 10SM FEW080 26/23 A2991 RMK AO2 SLP126 T02610228 Now, how can I change the code above, so that it will fetch a different file, which has the data stored in a different format such as this one: 2007/11/01 02:25 TAF AMD KMIA 010225Z 010224 05009G20KT P6SM VCSH FEW015 SCT025 BKN045 FM0300 05011KT P6SM VCSH FEW015 SCT025 BKN045 FM1400 03016G26KT P6SM VCSH FEW015 SCT025 BKN040 FM1800 01014G24KT P6SM VCSH FEW015 SCT025 BKN040 I changed the URL on the code to point to the new data, but it will not display anything. Here is the code that needs to be fixed: <?php function get_metar($station) { $fileName = "ftp://tgftp.nws.noaa.gov/data/observations/taf/stations/$station.TXT"; $metar = ''; $fileData = @file($fileName); // or die('Data not available'); if ($fileData != false) { list($i, $date) = each($fileData); while (list($i, $line) = each($fileData)) { $metar .= ' ' . trim($line); } $metar = trim(str_replace(' ', ' ', $metar)); } return $metar; } $dep_station = "KMIA"; $dep_metar = get_metar($dep_station); echo $dep_metar; ?> I might be wrong, but I think the code is not properly stripping down the data.
  5. Worked wonderfully! THANKS!!!!
  6. Hello guys and gals, How can I convert: $value = 4.51666666667; into hours:minutes? $hours = 4; $minutes = 30; Thanks for the help, as always!
  7. I didn't want to let you down, so here it is: $fuel = sprintf("%04d", $fuel);
  8. THANKS!!! I really appreciate it!
  9. Hello guys and gals, Please don't laugh, since I know this will be an easy question, but how can I make this value: $fuel = "19312.92"; end up looking like this: $fuel = "193"; And if possible, always insert a ZERO in front of the result, so that it ends up looking like this: $fuel = "0193"; Ok, stop laughing now. LMAO! Thanks for any help as always!
  10. Can the iframe be invisible and can it adjust itself to the document without displaying scroll bars? Also, if I print the page, will it also display what's inside the iframe?
  11. Hello guys and gals, I don't know if this is the right forum to ask this, but here it goes... Is there a way for me to be able to fetch a PDF from another site and display it on my website without having to open up Adobe Reader? In other words, I would like to have this PDF document: http://flightaware.com/resources/airport/ASE/APD/AIRPORT+DIAGRAM/pdf to be displayed on a page when a user opens a page on my website. Thanks for any help... ERuiz
  12. Thanks wildteen!!! Worked like a charm! Thanks to Richard too! I really appreciate the help guys, I really do.
  13. Try this: $time = $row['time']; $time = date("H:i:s", $time);
  14. I've tried and tried, Richard, but I can't get it to work.
  15. You gotta be kidding me, you serious? That simple? THANKS!
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.