Hi,
I'm new to PHP but have started playing and have a question concerning text files. When I use any PHP function to read a formatted text document such as a poem or short story all the text becomes one big paragraph with no indintations. I'm trying to create a web page that will take an uploaded text file and allow people to view that text file in its original format on an html page. Any suggestions. PHP may not be the answer but any help would be greatly appreciated.
Chupito
You may be looking for the HTML <PRE> tag. It will keep all line breaks, spaces, and indentations. HTML is parsed within this, as well.
Using a simple php code like:
<?readfile("C:/Program Files/readme.txt");
?>
where would I place the <pre>?
Never mind thanks for the help with your suggestion and about 3 minutes playing I figured it out. Thanks again for the suggestion.
CHUPITO😃
is the only way include the <pre> tags in the text file or is there a way to use them just in the php file? this is how I did it:
<pre> here goes my text just like I wrote it </pre>