如何从 PHP 变量获取 PHPSpreadSheet 中的新行或 CRLF - 即使引号也不起作用

问题描述 投票:0回答:0

我查看了 stackoverflow 上的文档和一些答案,但到目前为止对我没有任何作用。实际上,如果我在 setValue 调用中有文本或者如果我有 PHP 变量,这似乎会有所不同。

这不起作用:

$spreadsheet->getActiveSheet()->getCell('B' . $activerowcount)->setValue($paanhangfiles);

但这确实有效(与 PHP 变量相同的内容:

$spreadsheet->getActiveSheet()->getCell('B' . $activerowcount)->setValue("Anhang/Datei 1: https://joomla4.land-dinslaken.de/images/pressearchiv/1930-1939/1930/1930-04-20-Hamborner_GenAnz-Vorstand-S-1.webp\nAnhang/Datei 2: https://joomla4.land-dinslaken.de/images/pressearchiv/1930-1939/1930/1930-04-20-Hamborner_GenAnz-Vorstand-S-2.webp\nAnhang/Datei 3: https://joomla4.land-dinslaken.de/images/pressearchiv/1930-1939/1930/1930-04-20-Hamborner_GenAnz-Vorstand-S-3.webp");

我还尝试“引用”PHP 变量中的字符串,但这对我也不起作用。

php phpspreadsheet
© www.soinside.com 2019 - 2024. All rights reserved.