0

Hello,
I have a comment system that i wrote in PHP when i have used linebreak: $area = wordwrap($area, 62,"<br>",1); to auto break after 67 charectars so my comments don't go over a css box but when i write in uppercase; since the letters are larger it overflows. How can i stop this? You can see the effect of this here.

Sanchixx

4
Contributors
5
Replies
6
Views
5 Years
Discussion Span
Last Post by diafol
2

@Sanchixx

This is issue is close to CSS than PHP. You can used a DIV container to word-wrap

div {
    width: 300px;
    word-wrap: break-word;
}

Based on the example you provided I think this might work:

$area = wordwrap($area, 62,"<br />\n",1);

It's a bit hard to figure out it without actually see the whole script.

0

put scroll on the box inside or detect uppercase : if (preg_match('/[A-Z]+/', $str))

0

I'v already done all those things, and for checking if it's uppercase what if only part of the text is uppercase!

1

This works for IE9, Chrome, Safari: word-break:break-all;
This works for IE9, Chrome, Safari, Opera, Safari: word-wrap:break-word;

However, which versions started implementing this, I don't know.

In the days of RWD, static break-points (e.g. splitting) are redundant.

Edited by diafol

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.