Smarter word-wrap in PHP for long words?

前端 未结 5 1494
無奈伤痛
無奈伤痛 2020-12-05 18:53

I\'m looking for a way to make word-wrap in PHP a bit smarter. So it doesn\'t pre-break long words leaving any prior small words alone on one line.

Let\'s say I have

5条回答
  •  渐次进展
    2020-12-05 19:32

    You can use CSS to accomplish this.

    word-wrap: break-word;
    

    That will break the word for you. Here is a link to see it in action:

    http://www.css3.info/preview/word-wrap/

提交回复
热议问题