How to shorten a text?

Links for php scripts

Moderators: gesf, Michalio

Post Reply

The $a variable contains the news text. The $link variable contains a link to the page with the full text of this news.
Need to write the abbreviated text of the news in the $b variable according to the rules:
- crop up to 180 characters
- assign an ellipsis
- make the last 2 words and ellipsis a link to the full text of the news.

Do you have some code?

What have you tried?
Post Reply