PDA

View Full Version : Arrrrrh! Line Breaks!


Ian Cunningham
09-05-2003, 04:12 PM
I have made a hack for my site (http://www.pcreview.co.uk/modofthemonth.php) but line breaks done work when typed in the text box (only in that forum though).


For example, this paragraph would start right after the one above, with no space! Any ideas on what is up?

Ian Cunningham
09-05-2003, 04:51 PM
OK, I have figured out why it does this now, but not how to solve it...

I am calling the post information $post[pagetext] into the showthread template instead of parsing it properly in postbits and showthread.php

Do you know how I can add the auto <br> into it?

Xenon
09-05-2003, 06:16 PM
use the function nl2br() :)

Ian Cunningham
09-05-2003, 11:30 PM
you will have to excuse my lack of php ;) can you give me a little example of how I would use that?

Xenon
09-06-2003, 12:30 PM
$post[message] = nl2br($post[pagetext]);

then use $post[message] in your template :)