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.
originally i used this code to save my string :
myfile = fopen("$filnavn$dato.xls","w") or die ("Fejl fil ikke gemt");
fwrite($myfile, $txt);
fclose($myfile);
but learned that it was better to use
function WriteStringToFile($myfile,$txt){
$f=fopen($myfile);
$myfile= "\xEF\xBB\xBF".$myfile;
fputs($f,$txt);
fclose($f);
}
and yet this didnt work either. I have tried doing the
header('Content-type : text/plain; charset=utf-8');
but that doesnt seem to help either. Does anybody have any clue why my code wont work ? :)