0

This question is in reference to:

Free (preferably) PHP RTF to HTML converter?

I'm trying to execute that last line of code in my php:

exec(rtf2htm file.rtf file.html)

I understand what parameters need to go within the parentheses, I just do not know how to write it. I've looked at multiple examples along with the php documentation and still I remain confused, so could someone show me how it is written? rtf2htm refers to a PHP file which converts RTF to HTML.

Ultimately what I am trying to do is convert the content of numerous RTF docs to HTML, maintaining the formatting, while not creating tags such as<head> or <body> which programs like Word or TextEdit generate when converting to HTML.

4

1 回答 1

0

rtf2htm 不是 php 脚本,它是安装在服务器上的程序。exec() 用于调用外部应用程序。

编辑:查找此脚本后,似乎它确实是一个 php 脚本。但它已被编码为只能从命令行使用。

这应该有效:

<?php

exec('php /path/to/rtf2htm /path/to/source.rtf /path/to/output.html');

?>
于 2013-06-07T18:24:01.687 回答