This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (!function_exists('getFileLines')) { | |
/** | |
* Returns a Generator representation of file lines that we can then iterator over with foreach | |
* | |
* eg: | |
* $fileData = getFileLines('path.txt'); | |
* foreach ($fileData() as $line) { | |
* // $line contains current line | |
* } | |
* |