1

I'm attempting to build a CSV parser in PHP. Unfortunately I'm unable to use fgetcsv so I'm building a custom function.

I have the contents of the csv held in a string, I'm attempting to explode the string on the new line character but I'm having difficulties with this.

$array_of_lines = explode(PHP_EOL,$csv_string);

This doesn't work, neither does exploding on "\n", could any suggest what character I might need to explode on?

Jay Blanchard
  • 34,243
  • 16
  • 77
  • 119
Liam Fell
  • 1,308
  • 3
  • 21
  • 39

0 Answers0