Complimenting marcus at synchromedia dot co dot uk comment, you can also do something like this:
<?php
$file = new SplFileObject('/path/to/file', 'r');
while (!$file->eof()) {
$line = $file->fgets();
if (empty(trim($line))) {
continue;
}
}
While this may seem like a overkill for such thing, it allows you to do some processing with the empty lines that might come (I had to do this mostly because I needed to count empty lines instead of just skipping them). Since it also trims the line before checking if it's empty, you won't get lines composed only of empty spaces (I don't know if the flags also make it trim the content before checking it).