phpQuestioner Posted October 14, 2007 Share Posted October 14, 2007 how can a preserve a " " in a textarea if I am echoing it with php into the textarea? right now it is just echoing a blank space - like this " " all of my other html displays as plain text; except this - it is getting interpreted as a white space (like text/html, instead of text/plain). Quote Link to comment https://forums.phpfreaks.com/topic/73172-solved-preserving-nbsp-in-a-textarea/ Share on other sites More sharing options...
monkeybidz Posted October 14, 2007 Share Posted October 14, 2007 Do you have some code to post as a sample? Quote Link to comment https://forums.phpfreaks.com/topic/73172-solved-preserving-nbsp-in-a-textarea/#findComment-369104 Share on other sites More sharing options...
phpQuestioner Posted October 14, 2007 Author Share Posted October 14, 2007 it would be like this <?php $stringfromform = stripslashes($_POST['mytextstring']); <textarea class="ta"> echo " $stringfromform"; </textarea> ?> that's pretty much the way it is Quote Link to comment https://forums.phpfreaks.com/topic/73172-solved-preserving-nbsp-in-a-textarea/#findComment-369105 Share on other sites More sharing options...
monkeybidz Posted October 14, 2007 Share Posted October 14, 2007 Try this: <?php $stringfromform = stripslashes($_POST['mytextstring']); <textarea class="ta"> echo " $stringfromform"; </textarea> ?> Quote Link to comment https://forums.phpfreaks.com/topic/73172-solved-preserving-nbsp-in-a-textarea/#findComment-369106 Share on other sites More sharing options...
phpQuestioner Posted October 14, 2007 Author Share Posted October 14, 2007 monkeybidz - that still would not accomplish what I wanted to do; your not preserving the " " html character at all, you have just created spaces with your spacebar. also most browsers only interpret one empty space/whitespace, that is created with a spacebar; even if you create multiple spaces with your spacebar. i figured it out - but thanks for your help anyways. <?php $stringfromform = stripslashes($_POST['mytextstring']); <textarea class="ta"> echo " $stringfromform"; </textarea> ?> Quote Link to comment https://forums.phpfreaks.com/topic/73172-solved-preserving-nbsp-in-a-textarea/#findComment-369109 Share on other sites More sharing options...
monkeybidz Posted October 14, 2007 Share Posted October 14, 2007 Inquiring minds want to know. What was it? Quote Link to comment https://forums.phpfreaks.com/topic/73172-solved-preserving-nbsp-in-a-textarea/#findComment-369123 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.