bradkenyon Posted August 11, 2008 Share Posted August 11, 2008 I have an rtf file, well, multiple rtf's files that I want the php code to read and display on the webpage as html, or maybe display it as <pre>rtf file content</pre> What is a good way to go about this? Any help is appreciated. Link to comment https://forums.phpfreaks.com/topic/119138-display-rtf-file-as-html-on-page/ Share on other sites More sharing options...
DarkWater Posted August 11, 2008 Share Posted August 11, 2008 You need to first load the file into PHP with something like file_get_contents(). Then you can probably start by parsing out all the \n and making them into line breaks with nl2br(). Then you'll need to create some regexes to parse out all the RTF style flags in the file. Link to comment https://forums.phpfreaks.com/topic/119138-display-rtf-file-as-html-on-page/#findComment-613450 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.