Jump to content

[SOLVED] Php Styling


aarchaic

Recommended Posts

 

hey guys i have a little issue.

 

I'm working on a site where a person can put some information in about themselves

 

what happens is that once you wrote a nice long block of info and spaced it and so on you click save and it updates to my database.

 

but once you call it back in the website i just get 1 huge chuck of text and you lost all your spacings and formatting you did while writing the info.

 

can anybody please shed some light on how i can over come this?

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/159787-solved-php-styling/
Share on other sites

it depends on how you store and retrieve the data.  do you sanitize it in any way to remove formatting ?

 

Assuming this is done in a text area, you can use functions such as nl2br($text) to convert all of the newlines to the html equivolent <BR> for display purposes

 

Thanks! just what i needed :)

Link to comment
https://forums.phpfreaks.com/topic/159787-solved-php-styling/#findComment-842776
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.