0

Possible Duplicate:
how to extract data from csv file in php

Does anyone know of a PHP csv parsing library / class that works with csv generated by all kinds of programs and ideally finds the separator automatically? Everything I tried so far fails with one file or another.

3
  • Trying to figure out separators automagically is virtually impossible reliably. You should ask the user what the format it or make him use a specific separator. Commented Oct 25, 2012 at 15:20
  • If it would be doable, why doesn't Microsoft Excel or OpenOffice automatically do the right thing when importing CSV? They should have the ressources to get it right if it was possible. I think it isn't, because "CSV" is an underspecified description of content - you need explicit info of the separation characters used. Commented Oct 25, 2012 at 15:20
  • WebIt4Me/reader provides a tool to read or search through CSV file Commented Jun 30, 2015 at 22:38

1 Answer 1

3

There are native functions, such as str_getcsv()

Remember to be a better PHP developer and RTM.

Sign up to request clarification or add additional context in comments.

2 Comments

-1 for omitting the F. Four letter words aren't fun without the F.
@rambo coder. LOL. I originally had it. But felt my suggestion read harshly, so I removed it.