in reply to stupid/simple mistake

The $count++ is outside the foreach-loop ... so you are counting the lines of the file instead ... which seems to be 1.