Remove HTML tags from Strings on laravel blade

后端 未结 4 1187
深忆病人
深忆病人 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:19

    You can use strip_tags($yourString); to strip the html tags. In blade you could achieve this by

    {{ strip_tags($yourString) }} 
    //if your string is 

    my string

    //output will be my string.

    hope that is helpful :)

提交回复
热议问题