小编Abh*_*k.p的帖子

使用laravel从数据库中存在的大文本中获取少量文本

在我的laravel项目中,我有一个名为description(datatype:Text)的数据库列 .

我想从中取出仅2行文本.

我怎样才能在laravel中实现这一目标.

我需要借助正则表达式吗?

 <p>{!!  $article->articleDescription !!} </p><br>
Run Code Online (Sandbox Code Playgroud)

这就是我的文本在数据库中的样子.

    <h2>What is Lorem Ipsum?</h2>

<p><strong>Lorem Ipsum</strong>&nbsp;is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry&#39;s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the …
Run Code Online (Sandbox Code Playgroud)

javascript php regex laravel laravel-5.5

6
推荐指数
1
解决办法
84
查看次数

标签 统计

javascript ×1

laravel ×1

laravel-5.5 ×1

php ×1

regex ×1