You can set the length of the fread() so you can limit that amount of data that is read in.
However...what are you using to key off as an indicator in the text file that it has hit the end of page 1?
If you have a string in your text file like "PAGE 1"; you could use strpos() to locate "PAGE 1" and then use that in the fread() as it's length value.
Without some sort of indicator you can hardcode the fread() length to be X characters.
Look up fread() and strpos() for more information on getting what you want done.
Hope this helps
Sean Shrum