title: HTML to DOCX file with php
body: <p>code in index.php</p>
  
  <pre><code>&lt;?php
  
  $html = file_get_contents( $_REQUEST['fname']);
  $filename = 'form_' . uniqid () . '.doc';
  header("Content-type: application/vnd.ms-word");
  header("Content-Disposition: attachment; filename= . $filename");
  echo $html;
  
  ?&gt;
  </code></pre>
  
  <p>Path of html file </p>
  
  <pre><code>form_588f71c4e978d.html
  </code></pre>
  
  <p>after running </p>
  
  <pre><code>http://localhost/html2/html2wordf.php?fname=form_588f71c4e978d.html
  </code></pre>
  
  <p>i m getting below code </p>
  
  <pre><code>&lt;!doctype html&gt;
  &lt;html&gt;
  &lt;head&gt;
     &lt;meta http-equiv="Content-Type" content="text/html" charset="utf-8"&gt;
     &lt;title&gt;&lt;/title&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
  &lt;p&gt;hello&lt;/p&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>inside     </p>
  
  <pre><code>form_588f71c4e978d.doc 
  </code></pre>
  
  <p>but i want only <code>hello</code> 
  inside this file </p>
  
  <p>means html to doc data conversion is not working , it just changing its extension from .html to .doc and data inside both the file remain same </p>
  
  <p>any one getting my point ? Guide me   thanks </p>