Jump to content

partial text file reading & display


siclines

Recommended Posts

I am using the code below to display a text file:

 

<?php

$filename="http://weather.noaa.gov/cgi-bin/fmtbltn.pl?file=forecasts/marine/coastal/an/anz451.txt";
//open file
$fp = fopen($filename,'r');

//loop through each line in the file
while($line=fgets($fp))
{
//output current text file line
print $line."<br>";
}
//close file handle
fclose($fp);

?>

 

Is there a way to show only the lines 12 - 40?

 

 

Link to comment
https://forums.phpfreaks.com/topic/156862-partial-text-file-reading-display/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.