Read RTF files and generate a TXT file

3

How to read an RTF file and rewrite it in TXT format using PHP? I did tests using fopen() and file_get_contents() , but the results were not what was expected.

    
asked by anonymous 01.12.2015 / 20:38

1 answer

2

It would be easier if you used libraries for this purpose.

link

According to the example that is there in Github, you can do:

$doc = new \Jstewmc\Rtf\Document();
$doc->load('/path/to/file.rtf');
$doc->write('text'); 
    
15.12.2015 / 15:52