I guess the problem you encountered is because the text file syntax.The html will not interpret the newline character(RETURN key)as
, this is why it 不換行. I do not know a lot php, (I use asp), I do not know if you can save it as html file and read.
Just try to help, I am not a 高手.