title: File_get_contents and fwrite with word document (images are not saved)
body: <p>I'm coding a script in PHP which is taking an xml document with file_get_contents, i replace some caracters with str_replace and i write this file in a Word document with a fwrite.</p>
  
  <p>Exemple : </p>
  
  <pre><code>$myContent = file_get_contents("../ressources/fichiers/modeles_conventions/modele_convention.xml");
  
  $lettre = str_replace("@NOMENT@",utf8_encode($data['nomentreprise']),$lettre);
  
  $newFileHandler = fopen("../ressources/fichiers/conventions/lettre_convention_1.doc","a");
  fwrite($newFileHandler,$lettre);
  fclose($newFileHandler);
  </code></pre>
  
  <p>In localhost it's working but on a server the problem is :</p>
  
  <p>My xml file contains images, but my final .doc document doesn't retrieves these images.</p>
  
  <p>I don't understand why my images are not retrieved.</p>
  
  <hr>
  
  <p>Well i didn't find out a solution to my problem.</p>
  
  <p>I get my xml file (which is in reallity a .doc file with an .xml extension)</p>
  
  <pre><code>    $myContent = file_get_contents("../ressources/fichiers/modeles_conventions/modele_convention.xml");
  </code></pre>
  
  <p>I replace some stuff</p>
  
  <pre><code>    $myContent = str_replace("@NOM_ENTREPRISE@",stripslashes($data['nomentreprise']),$myContent);
      $myContent = str_replace("@STATUT_ENTREPRISE@",stripslashes($data['juridique']),$myContent);
  </code></pre>
  
  <p>I save my document</p>
  
  <pre><code>    //On génère la convention
      $newFileHandler = fopen("../ressources/fichiers/conventions/convention_".$data2['nomeleve']."_".$data2['prenomeleve']."_".$data3['idstage'].".doc","ab");
      fwrite($newFileHandler,$myContent);
      fclose($newFileHandler);
  </code></pre>
  
  <p>The xml document contains images, in localhost it retrieves images but not on the server.</p>
  
  <p>exemple of xml code :</p>
  
  <pre><code>&lt;w:r&gt;
   &lt;w:rPr&gt;
    &lt;w:rFonts w:ascii="Arial" w:h-ansi="Arial" w:cs="Arial"/&gt;
     &lt;wx:font wx:val="Arial"/&gt;
      &lt;/w:rPr&gt;
       &lt;w:pict&gt;
        &lt;v:shape id="_x0000_i1028" type="#_x0000_t75" style="width:48.75pt;height:24pt"&gt;
         &lt;v:imagedata src="wordml://06000003.emz" o:title=""/&gt;
        &lt;/v:shape&gt;
       &lt;/w:pict&gt;
  &lt;/w:r&gt;
  &lt;/w:p&gt;
  </code></pre>