title: html tags are not working in microsoft word document
body: <p>recently i am facing a problem while working with "creating a word document file using in php".</p>
  
  <p>in my website, there is a form. which includes 10 fields such as "name", "phone", "address" etc.</p>
  
  <p>when a user fills up these fields and submits the form, an email is sent to the administrator including the form and corresponding field values saying "mr xxx has submitted this form recently".</p>
  
  <p>i am using file handler for this. but when i am using html tags to make the file look better in word doc, html is not working there, rather it is printed in that doc file as a text.</p>
  
  <p>here is my code---></p>
  
  <pre><code>$fh = fopen(JPATH_BASE.'/files/form_'.$user-&gt;id.'_'.$form_id.'_'.$submit_id.'.doc',"w+");
          //print_r($post); exit;
          //ob_start();
          //$data = ob_get_clean();
          //$data = '';
          $data = $emailreceipttext;
          foreach($fieldsInArray as $fields)
          {
              foreach($post as $key=&gt;$p)
              {
  
                  if($key==$fields-&gt;name)
                  {
  
                  if(is_array($p))
                  {
                      $p = implode(",",$p);
                  }
                  $data = str_replace("{".$fields-&gt;name."}", $p, $data);
  
                  }
              }
          }
          //fwrite($fh, $data);
  
          //print_r($data);exit;
      //}
  
  
      /*print_r($data);
      exit;*/
      fwrite($fh, $data); 
      $file = 'form_'.$user-&gt;id.'_'.$form_id.'_'.$submit_id.'.doc';
  
      if (file_exists($file)) {
          header('Content-Description: File Transfer');
          header('Content-Type: application/msword');
          header('Content-Disposition: attachment; filename='.basename($file));
          header('Content-Transfer-Encoding: binary');
          header('Expires: 0');
          header('Cache-Control: must-revalidate, post-check=0,  pre-check=0');
          header('Pragma: public');
          header('Content-Length: ' . filesize($file));
          ob_clean();
          flush();
          readfile($file);
          exit;
          }
          fclose($fh);
          //echo hi; print_r($data); exit;
      $this-&gt;send_mail($data,$submit_id);
  </code></pre>
  
  <p>here $data is the variable which consist of the mail body. and i am using str_replace to store the values of the fields of that form.</p>
  
  <p>but the document is showing as follows---></p>
  
  <pre><code>&lt;p&gt;&lt;label&gt;name&lt;/label&gt;:&lt;b&gt;arnas sinha&lt;/b&gt;&lt;br/&gt;
  &lt;label&gt;phone&lt;/label&gt;:&lt;b&gt;9878790989&lt;/b&gt;&lt;br/&gt;
   &lt;label&gt;address&lt;/label&gt;:&lt;b&gt;india&lt;/b&gt;&lt;br/&gt;
  </code></pre>
  
  <p>etc.</p>
  
  <p>how to use the html format for creating word doc file?</p>