6
When I’m going to change or include some data from a textearea
I wanted you to save the line breaks. Also, when you show in a textarea
before the data that already exist I wanted to show with the lines breaks.
Then I’ll bring you two together textarea
and saved at the bank. I’ve looked at the break codes and tried here and it didn’t work, someone can help me?
Observações:</p>
<p>
<textarea name="obs" cols="150" rows="10" style="resize:none" readonly ><?php echo $obs; ?></textarea> <!-- Aqui somente mostra os dados do banco e queria com as quebras de linhas. -->
</p>
<br>
Para adicionar dados usar o campo abaixo.
<textarea name="obs1" rows="10" cols="150" style="resize:none" ></textarea> <!-- Aqui a pessoa digita o que irá adicionar com o texto acima e queria com quebra de linha. -->
Tried to use the
nl2br($obs)
?– Diego Souza
i put in the first textearea <?php echo nl2br($Obs); ? > and not breaking the lines. in the first you have to show the lines in each separate row and in the second I type the text and if I give enter I want you to save with the breaks. however as I put together the two text area have to have a line break between them
– Kelly Cris
But you’re saving the text in the bank using the
nl2br
?– Diego Souza
not pq already tried by and not accepted error.
– Kelly Cris
It makes a mistake? But it shouldn’t... so you have to save with
nl2br
and pull withnl2br
.– Diego Souza
did Aki and even gave. however it is showing the <br> inside the text area is like that? texte5<br /><br /><br /><br />
.
– Kelly Cris
No, it’s not like that. Do it like this:
$quebras = array("<br />","<br>","<br/>"); 
 $text = str_ireplace($quebras, "\r\n", $obs);
. Then take thenl2br
and makesecho $obs
in the textarea to see.– Diego Souza
the <br> continues to appear inside the text area
– Kelly Cris
How did you do ? I got it wrong in the end. Yeah
echo $text
.– Diego Souza
I had put it the way you say I changed it to $text and it worked. It’s the junction of textarea1 and 2 that’s stuck. type I put together $Obs with $Obs1 and rewrite in bank pq I want to add information I show q already has and in the bottom field write what needs to add and then together the two at the end... I was doing differently but as I know they will do wrong to dismembering.
– Kelly Cris
I’m doing Aki test and as I edit the information it’s putting line break more than it should. type instead of skipping one as I add information it’s putting more of a line break in the data anrteriores
– Kelly Cris
Edit your question and enter your current code.
– Diego Souza
mexi Aki and I managed to solve thanks!!
– Kelly Cris
Can you give me another hand? I need to show this $Obs q field I picked up in the textarea but without being inside it and with the line breaks
– Kelly Cris
Just take the
textarea
not and use the variable the same way.– Diego Souza
i took out the textarea and ta showing everything in a row and it’s not breaking.
– Kelly Cris
got put the <?php echo nl2br($text); ? > and was, hj ta hard to think....
– Kelly Cris