Kutsum, you can use the above code and simply do count($lines) to find the number of lines in the array.