I'm storing description data from textrea field to database. The problem is when i write a long line text without line breaks it's storing the same to database. I need to prevent line breaks depends on textarea width...
Asked
Active
Viewed 413 times
1 Answers
3
If I understand your problem correctly, it's that the output breaks the div you're putting it in - that makes it a CSS issue, not a PHP one.
You can use the word-wrap: break-word;
CSS attribute, which will break the words if they exceed the width of the container.
.break {
word-wrap: break-word;
width: 100px;
background: lightgray;
}
<div class="break">
Thisisaverylongstringexceedingthewidthofthecontainer
</div>

Qirel
- 25,449
- 7
- 45
- 62
-
Worked for me. Thanks)) – pwnz22 Jan 27 '17 at 11:18