php - How can I include break lines in mysql records? -
When someone types in the following, it is inserted into the database:
Hello, my name is John and I'm 22, and looking for a good time. My phone number is: 555- No, honestly, John D. I think the brake lines stay there, but it seems that when I pull back the value back, it is as follows.
Hello, my name is John and I'm 22, and looking for a better time. My phone number is: 555- No, honestly, John D. Is there a special type of area that keeps the format of the text that is inserted? I am pretty sure that it is already there because when I look at the field in the database, the breakline is visible. Maybe this is the way I am recovering it?
I prefer not to do some code to put in HTML tags, haha. Thanks!
If you are displaying text in the browser, you is html To insert tags. Browsers do not automatically enter line breaks for you, this is usually done with the function:
nl2br ($ message); However, you can also wrap your text around the tag, but I do not recommend it:
& lt; Pre & gt; $ Message & lt; / Pre & gt;
Comments
Post a Comment