Php echo textarea line break
I'm using an textarea to send text to my DB. Show Screenshot of db: When I'm reading from the DB it removes the line breaks, how can I keep them in $row['opmerkingen']?
asked Jun 14, 2011 at 14:00
1 When displaying
text, use By default, browsers display newlines as spaces, therefore they have to be converted to For those who find this useful - please consider using answered Jun 14, 2011 at 14:01
binaryLVbinaryLV 8,8322 gold badges39 silver badges42 bronze badges 1 An alternative to nl2br is to make use of the CSS attribute white-space:
answered Jun 14, 2011 at 14:17
Emil VikströmEmil Vikström 88.4k15 gold badges134 silver badges170 bronze badges 1 I put as follows but not working with single quotes.
Put the double quotes. Then worked.
When we getting data it is comming with \r\n. Also use the double quotes there. answered May 21, 2013 at 13:02
Sumith HarshanSumith Harshan 6,0782 gold badges35 silver badges35 bronze badges 0 Not the answer you're looking for? Browse other questions tagged php html textarea or ask your own question.
Add Line Break in PHP# php 7.* sun moon #php 7.x Sun Moon #php 7.x ". "Have a great time here" ?> Welcome to Delft Have a great time here How to add a line break within echo in PHP? [closed]echo "Thanks for your email. /n Your orders details are below:".PHP_EOL; echo 'Thanks for your email. /n Your orders details are below:'.PHP_EOL; echo "kings \n garden"; kings garden echo nl2br ("kings \n garden"); kings garden so "\n" not '\n' $myfile = fopen("test.txt", "w+") ; $txt = "kings \n garden"; fwrite($myfile, $txt); fclose($myfile); kings garden echo "Thanks for your email" ." echo __("Thanks for your email.\n Add Line Break in PHP# php 7.* sun moon #php 7.x Sun Moon #php 7.x ". "Have a great time here" ?> Welcome to Delft Have a great time here How to echo an input of an textarea with line breaks?white-space: pre-line; echo $row['text'].'\n'; How To echo a line break in the browser?if (file_exists($fName)) { echo "CreationTime: ".$CreationTime. "CurrentTime: ".$CurrentTime. "after ".($fLifeTime)." Days from Creation: ".$fAge; } if (file_exists($fName)) { echo "CreationTime: ".$CreationTime. " if (file_exists($fName)) { echo ""; echo "CreationTime: ".$CreationTime. PHP_EOL . "CurrentTime: ".$CurrentTime. PHP_EOL . "after ".($fLifeTime)." Days from Creation: ".$fAge; }if (file_exists($fName)) { echo "CreationTime: ".$CreationTime. " |