OHLÁLÁ OHLÁLÁ - 6 months ago 9
PHP Question

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)?

Answer

CSS.

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