-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
  • 26,538
  • 10
  • 45
  • 61
user3911183
  • 787
  • 1
  • 12
  • 34

1 Answers1

5

You are looking for nl2br function.

echo nl2br(readfile("file.txt"));
pavel
  • 26,538
  • 10
  • 45
  • 61