-1

how to read a .txt file showing the html tag and interpreting the \n in the file.

I'm using a script php to read those files:

echo readfile("file.txt");

thanks.

pavel
  • 25,361
  • 10
  • 41
  • 58
user3911183
  • 787
  • 1
  • 10
  • 32

1 Answers1

5

You are looking for nl2br function.

echo nl2br(readfile("file.txt"));
pavel
  • 25,361
  • 10
  • 41
  • 58