Hi,
I would like to program a script that will selectively parse out certain lines on a text file:
e.g:
Supposing we have a text file "text.txt" that contains 100 lines of text.
What I want to do is:
//open text file
if($page == "1"){
//for lines 1 to 10, print them;
for($i=1;$i<=10;$i++){
//print line of text
}
}
if($page == "2"){
//for lines 11 to 20, print them;
{
if($page == "3"){
//for lines 21 to 30, print them;
}
etc etc
I'm fairly new to PHP, but I program in Java. I know how to do this in Java, but when it comes to PHP I'm kinda lost due to the semantics...if anyone could give me a hint, that would be great!
Thanks and regards,
Leonard Teo