I have a simple bulletin board I'm working on and would to run all of my HTML inline for performance and/or OCD. Right now if I submit a message with multiple lines by hitting Enter and then you view the page source it breaks it up into several lines... example:
I would like it to run those <br>'s inline with the rest of the source code instead of making a new line, but I'm having trouble figuring it out. I'm using this snippet below to find Enter spaces/new lines with "\n" and then using a <br> in place:
function fixtabspa( $txt )
{
$srch = array( "\n", "\t", ' ', ' ' );
$replc = array( '<br>', ' ', ' ', ' ' );
return str_replace( $srch, $replc, $txt );
}
and on the posting form we call that function simply:
$post_message = fixtabspa( $post_message );
Any clue on how to replace those \n's with <br>'s without making new lines in the source code? Thanks