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

ene's avatar
Level 2

Call to undefined function str_limit()

what am i doing wrong Call to undefined function str_limit()

  <p class="p-2">
                    {{ str_limit($post->body, 100, '') }}
                    @if (strlen($post->body) > 100)
                        <span id="dots">...</span>
                        <span id="more">{{ substr($post->body, 100) }}</span>
                    @endif
 </p>
                <button onclick="myFunction()" id="myBtn">Read more</button>
0 likes
2 replies

Please or to participate in this conversation.