Welcome Guest, Not a member yet? Register   Sign In
[SOLVED]what happens to textarea content when inserted to the db?
#7

[eluser]bobbob[/eluser]
Solved it with this function from someone else:

Code:
<?php
function removeLineBreaks($input)
{
   $input     = preg_replace('/(?<!\n)\n(?!\n)/', "<br />", $input);
   $output     = str_replace("\r", "", $input);
  
   return $output;
}
?&gt;

&lt;?php echo removeLineBreaks($description); ?&gt;


Messages In This Thread
[SOLVED]what happens to textarea content when inserted to the db? - by El Forum - 05-04-2009, 11:29 AM



Theme © iAndrew 2016 - Forum software by © MyBB