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.
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.
It would be easier if you used libraries for this purpose.
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');