Well, if each line holds an id, and you use the file() function to read the file into an array, then the elements you want will be in $array[$offset] to $array[$offset + $elements_per_page]. You can use a for loop to extract those to another array or something...
Diego