I have an HTML page which formats text as show below. I want to generate a text file with the same formatting.
Text1 Text2
This is the paragraph1
Text
01.03.2017
This is the paragraph 2
Currently, I am using the html2text
class but the output I got is different,it shows this below output
include("html2text/html2text.php");
$text = convert_html_to_text($my_var);
Generates
Text1 Text2 This is paragraph 1 Text 01.03.2017 This is the paragraph2
So everything in in one line. But I want in the same format as when the HTML document render. How do I achieve this?