Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Rustproof's avatar

str_limit remove the "..."

When using str_limit to limit text, is there a way to remove the addition of three periods? ...

I'm sizing/styling the first character in a paragraph and thought it would be easy to use str_limit, however it keeps adding ...

The documentation for the helper also states that " ... " will be included.

https://laravel.com/docs/5.6/helpers#method-str-limit

0 likes
4 replies
Rustproof's avatar

Here is the code I'm using.

{!! str_limit($brochure->content, 1) !!} or {{ str_limit($brochure->content, 1) }}
Cronix's avatar

The documentation also says you can customize that in the 3rd parameter. Just set it to empty strings ('')

You may also pass a third argument to change the string that will be appended to the end:

{!! str_limit($brochure->content, 1, '') !!}
1 like

Please or to participate in this conversation.