Remove HTML tags from Strings on laravel blade

后端 未结 4 1126
深忆病人
深忆病人 2021-02-11 16:01

I want remove HTML tags (all) from a string on laravel blade ...

code

{!! \\Illuminate\\Support\\Str::words($subject->body, 5,\'...\')  !!}

4条回答
  •  无人共我
    2021-02-11 16:02

    As for me, I use this construction:

    {!! str_limit(strip_tags($post->text), $limit = 50, $end = '...') !!}
    

    I hope, my code was helpful for somebody)

提交回复
热议问题