[Solved] PHP finish text with … if it is too long


There’s no need to apply any PHP programming logic here.

This thing can be achieved in CSS easily.

.text-ellipsis {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

And add this class to your span:

<span class="text-ellipsis">WWWWWWWWWWWWW</span>

0

solved PHP finish text with … if it is too long