Skip to content

Instantly share code, notes, and snippets.

@andboson
Created January 29, 2015 08:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andboson/0bb4f7c72ad7362febea to your computer and use it in GitHub Desktop.
Save andboson/0bb4f7c72ad7362febea to your computer and use it in GitHub Desktop.
$file = file($usersFile->getPathname());
$header = str_getcsv(array_shift($file));
$usersArray = array_map(function ($line) use ($header) {
$row = str_getcsv($line);
return (object)array_combine($header, $row);
}, $file);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment