Skip to content

Instantly share code, notes, and snippets.

View jschreuder's full-sized avatar

Jelmer Schreuder jschreuder

View GitHub Profile
@jschreuder
jschreuder / CsvParser.php
Last active August 29, 2015 14:03
I read the article saying (among other things) you shouldn't write your own CSV parser. So I decided to write one. And get a bit of practice with PHP 5.5's generators in the process.
<?php
namespace Webspot\Csv;
use Webspot\Csv\Parser\LineIn;
use Webspot\Csv\Parser\RowOut;
class Parser
{
const STATE_NEW_FIELD = 10;