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

lchogan's avatar

str_limit and escaping

Forgive me if this is a newb question, but when I use str_limit the double curly braces don't seem to escape entities properly. Is this intended behavior or am I misunderstanding how this all works?

0 likes
5 replies
absiddiqueLive's avatar

@lchogan please use {!! instate of {{ and !!} instate of }} then it will work

str_limit('test string it is', 7);

if problem put you code here !

lchogan's avatar

I'm sorry it has been a long day. I was thinking html entities in {{}} don't show up at all but this is behaving as it should. Thanks for the reply.

Rustproof's avatar

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

Please or to participate in this conversation.