S
S
ssvv962020-05-22 16:27:42
PHP
ssvv96, 2020-05-22 16:27:42

How to truncate menu item name with ellipsis if it is longer than 15 characters?

Hi all. I'm trying to implement "cutting" the name of a menu item more than 15 characters to 12 characters and set an ellipsis at the end. Tried to implement through the concatenation operator, but nothing came of it. How can this be done correctly? thank you in advance

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Neverov, 2020-05-22
@ssvv96

https://www.php.net/manual/ru/function.mb-strimwid...
But it's better to use
htmlbook.ru/css/text-overflow

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question