Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Reading CSV file, line with small checks
- public function getRecords() {
- $result = array();
- if(($handle = fopen($this->filePath.$this->fileName, 'r')) !== FALSE) {
- while(!feof($handle)) {
- if(($output = fgetcsv($handle, null, $this->delim, $this->quoteType)) === FALSE) {
- continue;
- }
- if(!isset($output[1]) && '' === trim($output[0])) {
- continue;
- }
- if(empty($output)) {
- continue;
- }
- $result[] = $output;
- }
- }
- fclose($handle);
- return $result;
- }
Add Comment
Please, Sign In to add comment