Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

mathishuettl's avatar

Read CSV-File (problem with richtext)

I try to read a CSV-File, but I have problems, because in the CSV-File there is richtext with line breaks and this leads to a wrong result in my output.

I read the csv using this code

$csvAsArray = array_map("str_getcsv", file($request->file("csv")->getPathname(), FILE_IGNORE_NEW_LINES));

My CSV looks like this: https://i.postimg.cc/yYsPt3dg/Screenshot-2023-12-17-173147.png

0 likes
0 replies

Please or to participate in this conversation.