Created
June 9, 2020 16:31
-
-
Save natrod/985bf05efabd7a8e036e8287fc06268a to your computer and use it in GitHub Desktop.
This file contains hidden or 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
//Read CSV file | |
$fileData = function($file) { | |
$file = fopen(__DIR__ .'/'. $file,'r'); | |
if (!$file) | |
die('file does not exist or cannot be opened'); | |
while (($line = fgets($file)) !== false) { | |
yield $line; | |
} | |
fclose($file); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment