Skip to content

Instantly share code, notes, and snippets.

@StephanWeinhold
Created May 20, 2016 05:54
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save StephanWeinhold/297c90eed4efd736183c4cab3b4eec3b to your computer and use it in GitHub Desktop.
Save StephanWeinhold/297c90eed4efd736183c4cab3b4eec3b to your computer and use it in GitHub Desktop.
/**
* @param string $absolutePathToCsvFile
* @param string $csvFilename
* @return array $data
* @throws Exception $e
*/
private static function readCsvFile($absolutePathToCsvFile, $csvFilename)
{
try {
$data = array_map('str_getcsv', file($absolutePathToCsvFile . '/' . $csvFilename));
}
catch (Exception $e) {
throw $e;
}
return $data;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment