title: Create doc file and write image to it using PHP
body: <p>I want to create report in doc file this will include images and table.
  I wrote a following code</p>
  
  <pre><code>&lt;?php
  @header("Cache-Control: ");// leave blank to avoid IE errors
  @header("Pragma: ");// leave blank to avoid IE errors
  @header('Content-Description: File Transfer');
  @header("Content-type: application/vnd.ms-word");
  @header("Content-Disposition: attachment; filename=report.doc");
  ?&gt;
  
  &lt;img src="http://l1.yimg.com/dh/ap/default/130613/fruit-chaat.jpg" border="0" style="border:none"&gt;
  &lt;br&gt;
  &lt;table style="border:2;background-color:red;"&gt;
  &lt;?php 
  $arr = array();
  $arr = array(1,2,3,4,5,);
  foreach($arr as $row=&gt;$value){  ?&gt;
      &lt;tr&gt;&lt;td&gt;First &lt;?php echo $value; ?&gt;&lt;/td&gt;
      &lt;/tr&gt;
  &lt;?php } ?&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>But It write image from a location if that location is not reachable that image will not display in document file. I used  to embed image but this embeds code instead of image. Please suggest some solutions.
  Is there any other way to doIt.
  I know about Com object but it works only on window. I am doing development on linux server.</p>