ChadNomad Posted August 2, 2007 Share Posted August 2, 2007 How can I read specific lines from a file? For example I have a text file with 100 lines and want to read only lines 80-90. Thanks Link to comment https://forums.phpfreaks.com/topic/63046-solved-reading-specific-lines/ Share on other sites More sharing options...
trq Posted August 2, 2007 Share Posted August 2, 2007 <?php $lines = file('/path/to/file.txt'); for($i = 81; $i <= 91; $i++) { echo $lines[$i]."\n"; } ?> Link to comment https://forums.phpfreaks.com/topic/63046-solved-reading-specific-lines/#findComment-313993 Share on other sites More sharing options...
ChadNomad Posted August 2, 2007 Author Share Posted August 2, 2007 The simple things are always the hardest to find on the net. Thanks!!!! Link to comment https://forums.phpfreaks.com/topic/63046-solved-reading-specific-lines/#findComment-314120 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.