title: Converting HTML code to plain TEXT with formatting available to text-files
body: <p>The task: taking HTML page and keeping only text from it with formatting available for simple text: so if there was <code>&lt;br&gt;</code> tag I'd like to convert it to /r/n, if there was a table - I'd like to keep the initial structure of this table in the resulting text and so on.</p>
  
  <p>There are built-in PHP function <code>strip_tags()</code> which is not really fits my requirements as it will keep the contents of styles and scripts and will not keep the formatting deleting <code>&lt;br&gt;</code>, <code>&lt;table&gt;</code> and other tags.</p>
  
  <p>I also have read the <a href="https://stackoverflow.com/questions/18587830/strip-html-css-from-string">stack question 'strip html,css from string'</a> but there's no answer I'm looking for.</p>
  
  <p>Essentially I'm looking for a way to render an HTML page to TXT file (with no links and images). Is it possible? Is there any libraries doing this thing?</p>