Using Reader to read and parse CSV strings
As title, is it possible to let the Reader class can parse the CSV strings instead of parsing the CSV file?
@jwage, can you concern about this feature request if possible?
Thanks.
It isn't possible right now but could be with a little refactoring.
@jwage, thank you for your quick reply :+1:. Actually, I have to know this feature possibility. And I want to add this feature via PR if possible. I want to get some tips for developing this feature. I also need to use this feature for my project and I can help you to develop this.
Thank you for your concern again!
So not sure what exactly I'm reading but I need a lawyer and a federal Marshall to take the issue out of my life.
With minimum refactoring you can just rename $path as $path_or_content and then in initializeHandle if $mode is null (let's suppose we use this convention when $path_or_content is a string content not a path) you do :
$handle = new SplFileObject("php://memory", "w+");
$handle->fwrite($this->path_or_content);
$handle->rewind();