0

I want to read a file "readme_en.txt". But when the content is displayed the first 2 simbols camed out of nowhere.The text file The Output.

$myfile = fopen("image/posts/readme_en.txt", "r") or die("Unable to open file!");
echo fread($myfile,filesize("image/posts/readme_en.txt"));
fclose($myfile);
deceze
  • 510,633
  • 85
  • 743
  • 889
  • There's actually a lot more stuff in there which isn't actually visible. Because you're reading a UTF-16LE encoded file, and output it to somewhere that's expecting ASCII or UTF-8. Open your file in a hex editor to see. – deceze Sep 29 '22 at 14:25
  • You were right. There were 2 strange simbols. I was able to modify the content. Thanks! – Alin Ene Sep 29 '22 at 14:32

0 Answers0