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 Quote 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"; } ?> Quote 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!!!! Quote Link to comment https://forums.phpfreaks.com/topic/63046-solved-reading-specific-lines/#findComment-314120 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.