Maintaining text spacing...

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
jkashu
Forum Commoner
Posts: 45
Joined: Tue Jan 30, 2007 12:00 pm

Maintaining text spacing...

Post by jkashu »

I'm trying to display the contents of a text file on webpage. How can I maintain the spacing and line breaks?

Example:
Text file looks like this:
This is just an example.

Thist is just an example.

This just an example.
This how it appears when it is read into the php page:
This just an example. This is just an example. This is just an example.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

nl2br() may be of interest.
jkashu
Forum Commoner
Posts: 45
Joined: Tue Jan 30, 2007 12:00 pm

Post by jkashu »

It works perfectly... Thanks so much!
Post Reply