It sounds like you have a file with 10000+ lines in it, that you need to split into 50 line chunks and save to new files...
If the file is well over your php memory limit, reading the whole thing into memory will only cause you headaches.
I'd highly suggest using SplFileObject to iterate over the file line by line. This will give you a much smaller memory footprint.
Create a blank file also using SplFileObject, iterate over 50 lines of the original file, writing each line to the new blank file.
Keep a counter of how many lines you've read through. When you've reached 50, simply increment the blank file you're using.
I'll be happy to share code examples.