Jump to content

[SOLVED] Formatting text through php


Infected.Shadow

Recommended Posts

Okay so I haven't written any code for this yet. I would also like to apologize if I'm not communicating this thoroughly. I'm finding it hard to describe the problem at hand.

 

My problem is this:

 

Say a user enters this into a text field:

 

This is a line!

 

This line is lower!

 

Now on most sites I've been to, it would output like that on the page. When I go to try this in my code it always ends up coming out like this:

 

This is a line! This line is lower!

 

So usually I'm pulling these values from a database, so I'm wondering if there is a function in php that will keep the same formatting the user wants (Spaces, line skips, etc.). Any help would be greatly appreciated.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.