title: excel PHP UTF-8
body: <p>hi i am using PHP to save some data in xls format, and i need to use UTF-8 because some of the characters that the user input could be ÆØÅ ive tried several solutions there were written on the forums, but without any luck.</p>
  
  <p>originally i used this code to save my string : </p>
  
  <pre><code>myfile = fopen("$filnavn$dato.xls","w") or die ("Fejl fil ikke gemt");
  
  fwrite($myfile, $txt);
  fclose($myfile);
  </code></pre>
  
  <p>but learned that it was better to use </p>
  
  <pre><code>function WriteStringToFile($myfile,$txt){
      $f=fopen($myfile);
      $myfile= "\xEF\xBB\xBF".$myfile;
      fputs($f,$txt);
      fclose($f);
  }
  </code></pre>
  
  <p>and yet this didnt work either. I have tried doing the </p>
  
  <pre><code>header('Content-type : text/plain; charset=utf-8');
  </code></pre>
  
  <p>but that doesnt seem to help either. Does anybody have any clue why my code wont work ? :)</p>