php-export-data icon indicating copy to clipboard operation
php-export-data copied to clipboard

new line character in the cell value

Open jimiwhite1020 opened this issue 10 years ago • 1 comments

New lines in the cell value is not working when you open it via excel. It said all new lines characters should be replaced with like this:

<Cell><Data ss:Type="String">Thank you for your message. Thanks,</Data></Cell>

jimiwhite1020 avatar Jun 05 '15 07:06 jimiwhite1020

@jimiwhite1020

Below the line that reads

$item = str_replace('&#039;', '&apos;', htmlspecialchars($item, ENT_QUOTES));

add this:

$item = str_replace("\r\n", '&#10;', $item);

ideiasfrescas avatar Feb 27 '21 13:02 ideiasfrescas