如何使用 php 在 pdf 创建中包含换行符和空格?
我正在尝试使用 php 创建 pdf 文档。
但是,我无法在 pdf 中获取新行。
nl2br
不起作用,所以我使用了
$newadd = nl2br(str_replace('\r', ' ', $inputSafe['address']));
现在我在 html 中得到了正确的输出,
Naduvilachirayil House, Anaprampal North P.O, Thalavady
但在 pdf 中,我只得到
Naduvilachirayil House,<br>Anaprampal North P.O,<br>Thalavady.
I am trying to create a pdf document using php.
But, I can't get new line in the pdf.
nl2br
is not working so I have used
$newadd = nl2br(str_replace('\r', ' ', $inputSafe['address']));
Now I got the correct output in html as
Naduvilachirayil House, Anaprampal North P.O, Thalavady
But in pdf, I am getting only
Naduvilachirayil House,<br>Anaprampal North P.O,<br>Thalavady.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看看这是否有帮助:
see if this helps: