如何将ckeditor html输出转换为普通字符串和限制字符串

how to convert ckeditor html output to normal string and limit string

我正在使用 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)) !!}