![]() |
Reading from txt file..
Hello.. This is my first question and just want to say before it that this is awesome forum!! Thanks for that..
Ok.. I need to read text file and every second line ONLY!? Like this: 0 2 4 6 8 10 and so on.. I have here my script which will print all lines. If someone could look at it and maybe quide me how to modify this so it will print only every second line like I sayd before. Code:
$filename = "postitoimi.txt";anyway, thanks for all help! - Marxx |
This code gives you a basic idea of how to do this. We loop through the lines in the file and issue the
continue construct to any lines that are odd. So it begins at line 1, skips line 2, prints line 3, etcetera...Glad you like it here as well :) ! PHP Code:
|
wow.. Thanks for faaaast reply!
Well, yeah.. I think I can go from here. It looks actually really simple.. Thank you Wildhoney. |
Haha, that looked really simple wild~ :D
|
| All times are GMT. The time now is 07:16 PM. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0