Answer the question
In order to leave comments, you need to log in
How to read CSV file with line breaks in cells?
There is a CSV file where the last cell has line breaks (a lot of line breaks in one cell), I would like to read exactly these transfers into the array, so that later I could work with them (at the moment it reads everything in one line), I can’t solve this issue.
Example code how to read the file:
$handle = fopen("lun.csv", "r");
$price_stock = array();
while (($line = fgetcsv($handle, 0, ';')) !== FALSE) {
$price_stock[] = $line; //Записываем строчки в массив
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question