Mokus
Mokus

Reputation: 10400

Text length in php

I have a text and I want to cut this in the end of the line, I don't want a page break, with Arial it's easy to do because all font size is the same, but I'm using a font type where the fonts size is very different, for example i and w. So it's hard to determine the size of the text in the screen,

What is the easiest way to do this, on the server side (php, imagettfbbox) or on the client side (javascript, jQuery)?

Upvotes: 1

Views: 115

Answers (1)

JJJ
JJJ

Reputation: 33163

CSS.

white-space:nowrap;
overflow-x:hidden;
width:100px;

Upvotes: 5

Related Questions