如何通过 PHP 从表单提交中制作 RTF(富文本格式)文档?
我正在谷歌上搜索,但我得到的大多数结果都使用了这些复杂的软件。我选择使用 RTF,因为它是直接通过 PHP 进行编码的最简单方法,之前也这样做过,但忘记了我从哪个网站获得帮助。
有人可以给我一个关于如何使用 php 将预先编写的 rtf 文档中的可插入变量替换为 mysql 表单数据的简短摘要吗?我在 rtf 文档中用 $variable1、$variable2 等标记了变量插入位置,这对应于我的 mysql 表中的变量名称。
或者有人可以向我提供一个现有教程的链接吗?
编辑:如果它使用预先编写的软件,它必须是免费的。
I'm searching on Google but most of the results I'm getting have these complicated software being used. I'm choosing to use RTF because it's the easiest to code straight through PHP and did it before but forgot the website I was getting help from.
could someone give me a brief summary of how to replace insertable variables in a pre-written rtf document with mysql form data using php? I have variable insertion locations marked in my rtf document with $variable1, $variable2 etc, which corresponds to the variable names in my mysql table.
Or could someone provide me with a link to an already existing tutorial on it please?
edit: and if it uses a prewritten software, it has to be free.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
带替换的基本 rtf: http://www.tuxradar.com/practicalphp/11/3/ 0 实际上取决于您预先编写的 rtf 的复杂程度
,或者您可以在检索数据时构建一个 rtf 文档,就像使用 html 一样。
或使用类似的类: http://www .phpclasses.org/package/1805-PHP-Create-RTF-documents-from-HTML.html
Basic rtf with replace: http://www.tuxradar.com/practicalphp/11/3/0 just really depends on how complex your pre-written rtf is
or you could build an rtf document as the data is retrieved, much like you would with html.
or use a class like: http://www.phpclasses.org/package/1805-PHP-Create-RTF-documents-from-HTML.html
试试这个 http://www.daniweb.com/web-development/php/threads /320472
Try this http://www.daniweb.com/web-development/php/threads/320472
我找不到我正在寻找的 rtf 教程,所以决定使用 pdf,这在这个堆栈溢出问题中已经得到了很好的解释。
如何使用 PHP 制作 pdf 文件
I couldn't find the rtf tutorial I was looking for so just decided to use pdf, which is already well explained here in this stack overflow question.
How to make a pdf file using PHP