Re: inserting spaces/returns in form postings
| From: | Matthew Kendall | Date: | Sun, 24 Dec 2000 00:10:13 +0000 |
| Subject: | Re: inserting spaces/returns in form postings | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-31719@lists.php.net to get a copy of this message | ||
"Police Trainee" <policetrainee@yahoo.com> wrote...
> is there anyway to translate or write extra spaces and
> carriage returns in a file so that it is reflected on
> a browser without making the user enter a <br> or
> each time they want a return or an extra space?
Turn the spaces and carriage returns into and <br> using search and
replace functions, or using functions provided for this purpose like nl2br:
http://www.php.net/manual/function.nl2br.php
Or enclose the text in the HTML file in <PRE></PRE> tags, which will make
the text display in a monospaced font with all spaces and linebreaks
preserved.