Jump to content

<pre> tags with readfile()


zimbabweo

Recommended Posts

I can't figure out how to combine readfile() with <pre> tags so that the \n linebreaks in my text file are displayed properly.

 

// works but doesn't print line breaks
echo readfile("filename.txt");

 

// doesn't work -- parse error

echo "<pre>readfile("filename.txt")</pre>";

 

// doesn't work -- parse error
echo "<pre>{readfile("filename.txt")}</pre>\n";

 

Any tips to solve this?

Link to comment
https://forums.phpfreaks.com/topic/275478-tags-with-readfile/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.