php/php-src — pull request #80 by srgoogleguy (2012-05-10 19:30:44+00:00)
Title: file() Feature Request - added support for file() to skip empty lines

This was originally submitted as a bug report in https://bugs.php.net/41315

However, after discussion on IRC views about whether or not it was a defined behavior or a doc bug differed slightly. So I am submitting this as a feature request in part to include the additional desired behavior.

This will allow FILE_SKIP_EMPTY_LINES to skip lines that only contain the EOL character. Previously the only way to achieve this was to use FILE_IGNORE_NEW_LINES with FILE_SKIP_EMPTY_LINES.

This FR also added a new flag for fil(), FILE_INDEX_LINES which will return an array where the key indexes the line number in the file. It functions in accordance with FILE_SKIP_EMPTY_LINES as well where keys maintain the respective line number associated with their place in the file.