I'm trying to get some post data formatted for output on a browser and I can't use pre tags becuase the width attribute isn't supported anymore and it doesn't really work. I also need to break up a word if it's over 80 characters long, if someone's been a pillock basically and posted some crap. However, if you could advise on that it would be great, but the real problem is I can't seem to replace the newlines with brs. Here's the code:
$bad = array("<",">","<",">");
$good = array("[","]","[","]");
preg_replace( "/[\r\n]+/" , "<br />" , str_replace( $bad , $good , mysql_real_escape_string( $_POST['post'] ) ) )
Any help?
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
LOL it looks like the owner of this site needs some help with the formatting too!