我正在使用laravel 5.5试图限制ckeditor字符串,但它输出我像这样
我的数据库
<p> something something something something something </p>
我是这样想的
{!! substr($content,0, 20) !!}
产量
<p> something ...
并没有关闭段落,这就是为什么我的页面崩溃,并没有正常工作
我怎样才能将ckeditor字符串转换为普通字符串并限制它
谢谢
使用strip_tags()
{!! strip_tags(substr($content,0, 20)) !!}