使用数据库显示带有 html 字符的文章:
$行->文章:
<div class="article">
As is usual also in Buenos Aires, is held in that city again the official Asterisk Advanced course with the new agenda <a href="http://www.google.com">google page</a>
</div>
使用:character_limiter($row->article, 160) 短文本,但碰巧剪断了超链接,导致html代码出错,我用函数strip_tags()解决...但是显示如下:
<div class="article">
As is usual also in Buenos Aires, is held in that city again the official Asterisk Advanced course with the new agendagoogle page...
</div>
如您所见,该函数删除了超链接标签,但也删除了周围的空格。
我读过这篇文章:Problem using strip_tags in php
...但使用设置为 2 个文本元素的正则表达式。我想知道你是否可以使用类似但未定义标签的东西。我希望你的帮助