Is it possible to display an RTF file inside a web page using PHP?

后端 未结 7 1769
长情又很酷
长情又很酷 2020-12-03 08:27

I have an RTF file that I want to display inside a web page after tags have been replaced with user input.

I would like to be able to display the RTF file without

7条回答
  •  生来不讨喜
    2020-12-03 08:32

    You can't just output a file from within PHP code. You need to extract the data from it, then print the contents inline.

    The php function 'file_get_contents' may do what you need. The functions manual is here: http://us2.php.net/filegetcontents

    A sample usage is here:

    $contents = file_get_contents('yourfile.rtf');
    

提交回复
热议问题