siclines Posted May 4, 2009 Share Posted May 4, 2009 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 More sharing options...
Ken2k7 Posted May 4, 2009 Share Posted May 4, 2009 Use file. That should give you an array of lines. So loop to echo 12 - 40. Link to comment https://forums.phpfreaks.com/topic/156862-partial-text-file-reading-display/#findComment-826328 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.