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.

Community
  • 1
  • 1
  • 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. – deceze Oct 25 '12 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. – Sven Oct 25 '12 at 15:20
  • [WebIt4Me/reader](https://github.com/webit4me/reader) provides a tool to read or search through CSV file – Ali Jun 30 '15 at 22:38

1 Answers1

3

There are native functions, such as str_getcsv()

Remember to be a better PHP developer and RTM.

Jason McCreary
  • 71,546
  • 23
  • 135
  • 174