title: Convert html with image to ms.word
body: <p>I have the html code as below:</p>
  
  <p><strong>file.html</strong></p>
  
  <pre><code>&lt;body&gt;
      &lt;h1&gt;TEST&lt;/h1&gt;
      &lt;p&gt;this is test&lt;/p&gt;
      &lt;table&gt;
          &lt;tr&gt;
              &lt;td&gt;1&lt;/td&gt;
              &lt;td&gt;2&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;3&lt;/td&gt;
              &lt;td&gt;4&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;5&lt;/td&gt;
              &lt;td&gt;&lt;img src="../../../wamp/www/html2doc/SGEPP.jpg"&gt;&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/table&gt;
  </code></pre>
  
  <p></p>
  
  <p><strong>html2doc.php</strong></p>
  
  <pre><code>&lt;?php
          $handle = fopen("doc2html.html","r");
          $contents = '';
                  while (!feof($handle)) {
                  $contents .= fread($handle, 8192);
                  }   
                  header("Content-type: application/vnd.ms-word");
                  header("Content-Disposition: attachment;Filename=html2word.doc");
                  echo $contents;
  ?&gt;
  </code></pre>
  
  <p><strong>The problems:</strong></p>
  
  <p>when I convert it,I get html2word.doc but I can get only all texts from html file.For the images in html file I can not get it, it is missing images.So I want to get all data from html and images also.How do I fix this?Anyone help me please,Thanks.</p>