Use PHP's file() method which will return an array of the lines. Read through using a for() loop and leave off the last iteration.